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]); Enumerable.Range((int)a, (int)(b - a + 1)).Where(n => { if (n % 3 == 0) return true; while (n != 0) { if (n % 10 == 3) return true; n /= 10; } return false; }).ToList().ForEach(x => Console.WriteLine(x)); } }