#include <iostream>ios
using namespace std;ide
int main()spa
{ci
int m[100],n,i,min,k;it
while (cin>>n) io
{class
if(n == 0) break; /*結束循環的條件*/stream
for (i = 0; i < n ; i++) 循環
{數據
cin>>m[i]; /*輸入該組數據*/
if (i == 0)
{
min = m[i]; /*初始化最小值*/
k = i;
}
if(m[i] < min)
{
min = m[i];
k = i;
}
}
if(m[0] > min)
{
m[k] = m[0];
m[0] = min;
}
for (i = 0; i < n ; i++)
{
if(i != 0)
cout<<" ";
cout<<m[i];
}
cout<<endl;
}
return 0;
}