exec('import sys\nfor j in map(int,sys.stdin):print(" ".join([str(i) for i in range(1,j) if i !=0 and i % 7 != 0]))')