#include
main()
{
int n,m;
int a[100],b[100];
while(scanf("%d",&n)!=EOF)
{
int i=0,j=0,t;
if(n==0)
break;
else
{
for(i=0;i
for(i=0;i
if(abs(a[j])
t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
}
for(i=0;i
printf("%d",a[i]);
if(i!=n-1)
printf(" ");
else
printf("\n");
}
}
}
}