m:-between(1,100,N),A is N-1,B is(A mod 10)+1,\+(B=1->writef("%r ",[1,N]);format("~*r ",[B,N])).