if __name__ == '__main__': i = 1 while True: two = str(2 * i) three = str(3 * i) four = str(4 * i) five = str(5 * i) six = str(6 * i) if ( sorted(two) \ == sorted(three) \ == sorted(four) \ == sorted(five) \ == sorted(six) ): break i += 1 print(i, two, three, four, five, six)