#include
#define N 51
void main()
{
int a[N],b[N],i,j,n,t;
scanf("%d",&n);
for(i=0;i scanf("%d",&a[i]); for(i=0;i for(j=0;j if(a[j] { t=a[j];a[j]=a[j+1];a[j+1]=t; } t=n/2; b[t]=a[0]; for(i=j=1;t-i>=0&&j { b[t-i]=a[j];b[t+i]=a[j+1]; } for(i=0;i printf("%-5d",b[i]); }
scanf("%d",&a[i]);
for(i=0;i for(j=0;j if(a[j] { t=a[j];a[j]=a[j+1];a[j+1]=t; } t=n/2; b[t]=a[0]; for(i=j=1;t-i>=0&&j { b[t-i]=a[j];b[t+i]=a[j+1]; } for(i=0;i printf("%-5d",b[i]); }
for(j=0;j if(a[j] { t=a[j];a[j]=a[j+1];a[j+1]=t; } t=n/2; b[t]=a[0]; for(i=j=1;t-i>=0&&j { b[t-i]=a[j];b[t+i]=a[j+1]; } for(i=0;i printf("%-5d",b[i]); }
if(a[j] { t=a[j];a[j]=a[j+1];a[j+1]=t; } t=n/2; b[t]=a[0]; for(i=j=1;t-i>=0&&j { b[t-i]=a[j];b[t+i]=a[j+1]; } for(i=0;i printf("%-5d",b[i]); }
{ t=a[j];a[j]=a[j+1];a[j+1]=t; }
t=n/2;
b[t]=a[0];
for(i=j=1;t-i>=0&&j { b[t-i]=a[j];b[t+i]=a[j+1]; } for(i=0;i printf("%-5d",b[i]); }
{ b[t-i]=a[j];b[t+i]=a[j+1]; }
for(i=0;i printf("%-5d",b[i]); }
printf("%-5d",b[i]);
}