문제보기
N = int(input()) cnt = 0 for i in range(1000000000000000): sen = str(i) if "666" in sen: cnt += 1 if cnt == N: print(i) break