import sequtils, strutils let ab = stdin.readLine.split.map parseInt a = ab[0] b = ab[1] for i in a .. b: if i mod 3 == 0: echo i continue if '3' in $i: echo i