using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yuki { class Program { static void Main(string[] args) { string[] str = Console.ReadLine().Split(); int A = int.Parse(str[0]); int B = int.Parse(str[1]); string str2; while (A <= B) { if (A % 3 == 0) { Console.WriteLine(A); A++; continue; } str2 = A.ToString(); if (str2.Contains('3')) { Console.WriteLine(A); A++; continue; } A++; } } } }