using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yukicoder { class Program { static void Main(string[] args) { string s = Console.ReadLine(); string[] t = s.Split(' '); long a = int.Parse(t[0]); long b = int.Parse(t[1]); for(long i = a;i <= b; i++) { if(i%3 ==0 || i.ToString().Contains("3")) { Console.WriteLine(i); } } } } }