using System; class Program { static void Main(string[] args) { string line = System.Console.ReadLine().Trim(); string[] Data = line.Split(' '); int A = int.Parse(Data[0]); int B = int.Parse(Data[1]); for(int i= A;i< B;i++) { if(i%3 ==0) { Console.WriteLine(i); } else if(i.ToString().IndexOf("3") != -1) { Console.WriteLine(i); } } } }