def is_permutation(s1, s2):
    return sorted(s1)==sorted(s2)

for x in range(1, 10**10):
    a=is_permutation(str(x), str(2*x))
    b=is_permutation(str(x), str(3*x))
    c=is_permutation(str(x), str(4*x))
    d=is_permutation(str(x), str(5*x))
    e=is_permutation(str(x), str(6*x))
    if all([a,b,c,d,e]):
        print (x)
        break

