N = int(input()) l = list("142857") ans = "0." for i in range(N): ans += l[i%6] if ans == "0.": print(0) else: print(ans)