program T implicit none integer(8)::a,b,c,d,e read(*,*)a,b do c=a,b do d=1,100 e=10**d if(mod(c,3)==0)then write(*,*)c cycle else if(mod(c,10)==3)then write(*,*)c cycle else if(int(c/e)==3)then write(*,*)c cycle end if end do end do end program T