import std; void main() { auto input = readln.split.to!(uint[]); auto A = input[0], B = input[1]; A.iota(B + 1).filter!(a => a%3==0||a.to!string.count("3")>0).each!writeln; }