using System; public class Program { static void Main() { string AB = Console.ReadLine(); string A_ = ""; int i = 0; while (AB.Substring(i,1) != " ") { A_ = A_ + AB.Substring(i, 1); i++; } int A = Convert.ToInt32(A_); int B = Convert.ToInt32(AB.Substring(i + 1)); int N = B - A; if (N >= 0 && N <= 100) { for (int d = A; d < B + 1; d++) { string d_ = d.ToString(); if (d % 3 == 0) { Console.WriteLine(d.ToString()); continue; } else if(d_.IndexOf("3") >= 0) { Console.WriteLine(d.ToString()); } } } } }