a, b = map(int, input().split()) for c in range(a, b+1): if c % 3 == 0 or c % 10 == 3 or 0 <= c - 30 < 10: print(c)