#include <stdio.h>
#define N 10
void pp(int*a,int n)
{
}
int main()
{
int i,j,k,t,a[N];
for(i=0; i<N; i++)a[i]=i*11;
pp(a,N);
for(i=10,j=0; --i;) {
j=j<N/2?(j*2+1)%N:(j*2)%N;
t=a[0];
a[0]=a[j];
a[j]=t;
}
pp(a,N);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNkZWZpbmUgTiAxMAoKdm9pZCBwcChpbnQqYSxpbnQgbikKewogIHdoaWxlKG4tLSlwcmludGYoIiVkICIsKmErKyk7CiAgcHV0Y2hhcignXG4nKTsKfQoKaW50IG1haW4oKQp7CiAgaW50IGksaixrLHQsYVtOXTsKICBmb3IoaT0wOyBpPE47IGkrKylhW2ldPWkqMTE7CgogIHBwKGEsTik7CiAgZm9yKGk9MTAsaj0wOyAtLWk7KSB7CiAgICBqPWo8Ti8yPyhqKjIrMSklTjooaioyKSVOOwogICAgdD1hWzBdOwogICAgYVswXT1hW2pdOwogICAgYVtqXT10OwogIH0KICBwcChhLE4pOwoKICByZXR1cm4gMDsKfQ==