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){ } String aS = s.substring(0,s.indexOf(" ")); String bS = s.substring(s.indexOf(" ")+1); int a = Integer.parseInt(aS); int b = Integer.parseInt(bS); for(int n = a; n <= b;n++){ if(n % 3 == 0){ System.out.println(n); } } } }