counter = 0
i = 1
while counter < 10:
if i % 5 == 0 and i % 7 == 0:
counter += 1
print(i,end=" ")
i += 1
counter = 0
i = 1
while counter < 10:
if i % 5 == 0 and i % 7 == 0:
counter += 1
print(i,end=" ")
i += 1