using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace lecture { class Program { bool hasThree(int value) { string str = value.ToString(); for (int i = 0; i < str.Length; i++) { if (str[i] == '3') { return true; } } return false; } bool check(int value) { if (value % 3 == 0 || hasThree(value)) { return true; } return false; } static void Main(string[] args) { Program program = new Program(); string[] row = Console.ReadLine().Split(); int A = int.Parse(row[0]); int B = int.Parse(row[1]); for (int number = A; number <= B; number++) { if (program.check(number)) { Console.WriteLine(number); } } } } }