def radixSort(alist, base=10):

    r = 1

    maxEl = max(alist)

    bins = [[] for i in range(base)]

    while r <= maxEl:

        for i in alist:
            bins[i]//r%base].append(i)

        alist = []
        for i in range(base):
            alist.extend(bins[i])
            bins[i] = []
        
        r *= base

    return alist

if __name__ == '__main__':

    uL = [54, 26, 93, 17, 77, 31, 44, 55, 20]
    sL = radixSort(uL[:])
    print(uL)
    print(sL)