#include<stdio.h> int main() { int i; for(i=1;i<1000;i++) { if(i%3==0&&(i%10==5||i/10%10==5||i/100==5)) printf("%d ",i); } return 0; }