import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
int n = sc.nextInt();
if(n==0){
return;
}
int sum = f(n);
System.out.println(sum);
}
}
public static int f(int n){
if(n<=4){
return n;
}else{
return f(n-1)+f(n-3);
}
}
}
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()) {
int n = sc.nextInt();
int m = sc.nextInt();
if(n==0&&m==0){
return;
}else{
int[] a =new int[n+1];
for(int i=0;i<n;i++){
a[i]=sc.nextInt();
}
for(int j=n-1;j>0;j--){
if(a[j]>m){
a[j+1]=a[j];
}else{
a[j+1]=m;
break;
}
}
for(int i=0;i<n;i++){
System.out.print(a[i]+" ");
}
System.out.println(a[n]);
}
}
}
}
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
int n = sc.nextInt();
if(n==0){
return;
}else{
int[] a = new int[n];
for(int i=0;i<n;i++){
a[i]=sc.nextInt();
}
int temp;
for(int i=0;i<n-1;i++){
for(int j=i+1;j<n;j++){
if(Math.abs(a[i])<Math.abs(a[j])){
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
for(int i=0;i<n-1;i++){
System.out.print(a[i]+" ");
}
System.out.println(a[n-1]);
}
}
}
}