using System; using System.Linq; using System.Collections.Generic; namespace test20190423 { class Program { static void Main(string[] args) { var ss = Console.ReadLine().Split(new String[] { " " }, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray(); for (int i = ss[0]; i <= ss[1]; i++) { if (i % 3 == 0) Console.WriteLine(i); else if (i.ToString().ToCharArray().Any(x => x == '3')) Console.WriteLine(i); } Console.ReadLine(); } } }