from math import sqrt
count = 1
i = 1
while count < 3000:
i += 2
for k in range(2, 1+int(sqrt(i+1))): #range(2, i):
if i%k == 0:
break
else:
#print(i) ,
count += 1
#if count%20==0: print ""
print i
ZnJvbSBtYXRoIGltcG9ydCBzcXJ0Cgpjb3VudCA9IDEKaSA9IDEKd2hpbGUgY291bnQgPCAzMDAwOgogICAgICAgIGkgKz0gMgogICAgICAgIGZvciBrIGluIHJhbmdlKDIsIDEraW50KHNxcnQoaSsxKSkpOiAgICAjcmFuZ2UoMiwgaSk6ICAgCiAgICAgICAgICAgIGlmIGklayA9PSAwOiAgICAgICAKICAgICAgICAgICAgICAgIGJyZWFrCiAgICAgICAgZWxzZToKICAgICAgICAgICAgI3ByaW50KGkpICwKICAgICAgICAgICAgY291bnQgKz0gMQogICAgICAgICAgICAjaWYgY291bnQlMjA9PTA6IHByaW50ICIiCnByaW50IGk=