list = [3, 6, 9, 12, 13, 15, 18, 21, 23, 24, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 45, 48, 51, 53, 54, 57, 60, 63, 66, 69, 72, 73, 75, 78, 81, 83, 84, 87, 90, 93, 96, 99] first = input() split_first = first.split() A = int(split_first[0]) B = int(split_first[1]) for n in list: if A <= n & n <= B: print(n)