import std.stdio; import std.algorithm; import std.conv; void main() { int[2] input; readln.splitter.map!(to!int).copy(input[]); foreach (i; input[0]..(input[1] + 1)) { if (i % 3 == 0 || i % 10 == 3) { writeln(i); } else { for (long j = 10; j < i; j *= 10) { if (i / j == 3) { writeln(i); break; } } } } }