using System; using System.Linq; class Program { static void Main(string[] args) { var input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList(); int A = input[0]; int B = input[1]; var list = Enumerable.Range(A, (B - A)+1).ToList(); list = list.Where(x => x.ToString().Contains("3") || x % 3 == 0).ToList(); list.ForEach(x => Console.WriteLine(x)); } }