m:-readln(X),N is X-1,between(0,N,I),\+writef('%r%r ',[' ',N-1-I mod N,*,I mod N*2+1]).