using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Myon { static void Main() { string[] ss = Console.ReadLine().Split(' '); long a = long.Parse(ss[0]); long b = long.Parse(ss[1]); List cand = new List(); for (long i = a; i <= b; i++) { cand.Add(i); } var ans = cand.Where(n => { if (n % 3 == 0) return true; while(n!=0) { if (n % 10 == 3) return true; n /= 10; } return false; }); foreach (var item in ans) { Console.WriteLine(item); } } }