using System; using System.Collections.Generic; using System.Linq; namespace ContestCSharp { internal class Program { private static void Main() { string[] numbers = Console.ReadLine().Split( ' ' ); UInt32 a, b; UInt32.TryParse( numbers[ 0 ], out a ); UInt32.TryParse( numbers[ 1 ], out b ); for (var i = a; i <= b; ++i) { if (i % 3 == 0) { Console.WriteLine( i ); } else { if (i.ToString().IndexOf( '3' ) >= 0) { Console.WriteLine( i ); } } } } } }