#include<stdio.h> main() { int n,i,m; scanf("%d",&n); for(i=1;i<=n;i++) { if(i%3==0||i%5==0) printf("%d ",i); } }