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