n = int(input()) n = n % 30 lst_num = ['1', '2', '3', '4', '5', '6'] for i in range(n): first = i % 5 + 1 second = i % 5 +2 lst_num[first-1], lst_num[second-1] = lst_num[second-1], lst_num[first-1] print(int(''.join(lst_num)))
Freedom is a responsible choice.
n = int(input()) n = n % 30 lst_num = ['1', '2', '3', '4', '5', '6'] for i in range(n): first = i % 5 + 1 second = i % 5 +2 lst_num[first-1], lst_num[second-1] = lst_num[second-1], lst_num[first-1] print(int(''.join(lst_num)))