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); } foreach (var i in cand) { bool ok = false; if (i % 3 == 0) ok = true; var t = i; while (t != 0) { if (t % 10 == 3) ok = true; t /= 10; } if (ok) Console.WriteLine(i); } } }