using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class P { static void Main(string[] args) { string[] CSL = Console.ReadLine().Split(); int A = int.Parse(CSL[0]); int B = int.Parse(CSL[1]); int n = 0; string S_i = ""; for (int i = A; i <= B; i++) { n = 0; if (i % 3 == 0) { Console.WriteLine( i); continue; } S_i = i.ToString(); while(true) { if(S_i[n]=='3') { Console.WriteLine(i); break; } n++; } } Console.ReadKey(); } }