#请在...补充代码
import random
def genpwd(length):
return random.randint(10**(length-1),10**length-1)
length = eval(input())
random.seed(17)
for i in range(3):
print(genpwd(length))
def prime(m):
index = 0
while index < 5:
for i in range(2, m):
if m % i == 0:
break
else:
index = index + 1
if index < 5:
print("{},".format(m), end="")
else:
print("{}".format(m))
m = m + 1
n=eval(input())
m=round(n)
if n!=m:
prime(round(n)+1)
else:
prime(n)