using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yukicoder_207 { class Program { static void Main(string[] args) { string[] n = Console.ReadLine().Split(' '); int a = int.Parse(n[0]); int b = int.Parse(n[1]); for (int i = a; i <= b; i++) { if (i % 3 == 0 || i % 10 == 3) { Console.WriteLine(i); } else { int q = 0; for (int p = 1; p <= 9; p++) { if (i / Math.Pow(p, 10) == 3) { q++; } } if (q > 0) { Console.WriteLine(i); } } } Console.ReadLine(); } } }