N = int(input()) if N > 1000000: N //= 100 print(("285714" * N)[N-1])