using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Magatro { static void Main() { int[] AB = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray(); for (int i = AB[0];i<=AB[1];i++) { if (three(i)) { Console.WriteLine(i); } } } static bool three(int n) { if (n % 3 == 0) { return true; } if (n.ToString().IndexOf('3') > -1) { return true; } return false; } }