using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { int[] n = new int[2]; string[] strn = Console.ReadLine().Split(' '); int A = int.Parse(strn[0]); int B = int.Parse(strn[1]); if (A % 3 == 0) { Console.WriteLine(A); } else if (A.ToString().Contains("3")) { Console.WriteLine(A); } } } }