$,=$";print$_<3||-/^[35]$/||($_&1?(3,6,2,4,grep<.>,8..$_):grep<.>,2..$_)for<>