N = int(input()) a = divmod(N,6) s = '142857' l = '' for i in range(a[0]): l.append(s) for j in range(a[1]): l.append(s[j]) print(l)