for c in range(15):print''.join(`j`*(j/3==c+j/5)or' '[j<10:]for j in range(1,101)).rstrip()