// 迭代加深, 就是用dfs的方式写bfs, 记录一个最大深度
import java.io.*;
import java.util.*;
class Main{
static BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
static BufferedWriter log = new BufferedWriter(new OutputStreamWriter(System.out));
static int N = 110, n;
static int[] path = new int[N];
public static boolean dfs(int curDepth, int maxDepth){
if(curDepth > maxDepth) return false;
if(path[curDepth - 1] == n) return true;
Set<Integer> set = new HashSet();
for(int i = curDepth - 1; i >= 0; i--){
for(int j = i; j >= 0; j--){
int sum = path[i] + path[j];
if(sum > n || sum <= path[curDepth - 1] || set.contains(sum)) continue;
path[curDepth] = sum;
set.add(sum);
if(dfs(curDepth + 1, maxDepth)) return true;
}
}
return false;
}
public static void main(String[] args) throws Exception{
while(true){
n = Integer.valueOf(read.readLine());
if(n == 0) break;
int maxDepth = 1;
path[0] = 1;
while(maxDepth <= n && !dfs(1, maxDepth)){
maxDepth++;
}
for(int i = 0; i < maxDepth; i++){
log.write(path[i] + " ");
}
log.write("\n");
}
log.flush();
}
}