A="1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679"
B="8214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196"
a=[100,100]
def find(i,x):
if i==0:
return A[x-1]
elif i==1:
return B[x-1]
else:
return find(i-2,x) if x <= a[i-2] else find(i-1, x-a[i-2])
r=""
for n in range(18):
x=(127+19*n)*(7**n)
while a[-1] < x:
a.append(a[-2]+a[-1])
r=find(len(a)-1,x)+r
print r