3744 - ELHC
def prim(n):
cnt = 0 for i in range(1, int(n) + 1): if n % i == 0: cnt += 2 if i * i == n: cnt -= 1 if cnt == 2: return 1 else: return 0
if __name__ == '__main__':
n = int(input()) for i in range(2, n + 1): if prim(i): print(i, end=' ')