package ikagawado_alg32; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class SampleInput { public static void main(String[] args) { String s =""; try{ InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); s = br.readLine(); }catch(IOException e){ e.printStackTrace(); } String aS = s.substring(0,s.indexOf(" ")); String bS = s.substring(s.indexOf(" ")+1); long a=0; long b=0; try{ a = Long.parseLong(aS); b = Long.parseLong(bS); }catch(NumberFormatException e){ e.printStackTrace(); } for(Long n = a; n <= b;n++){ if(n % 3 == 0){ System.out.println(n); } } } }