Santa Claus has n candies, he dreams to give them as gifts to children.

What is the maximal number of children for whose he can give candies if Santa Claus want each kid should get distinct positive integer number of candies. Santa Class wants to give all n candies he has.

Input

The only line contains positive integer number n (1 ≤ n ≤ 1000) — number of candies Santa Claus has.

Output

Print to the first line integer number k — maximal number of kids which can get candies.

Print to the second line k distinct integer numbers: number of candies for each of k kid. The sum of k printed numbers should be exactly n.

If there are many solutions, print any of them.

Examples

Input

5


Output

2
2 3


Input

9


Output

3
3 5 1


Input

2


Output

1
2 
import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class ggg{
	
		private static InputStream stream;
		private static byte[] buf = new byte[1024];
		private static int curChar;
		private static int numChars;
		private static SpaceCharFilter filter;
		private static PrintWriter pw;
		private static long max=Long.MIN_VALUE;
		private static int mod=1000000000+7;
		private static int pa[][];
		private static long cnt=0;
		//private static HashMap<Integer,Long> map=new HashMap<Integer,Long>();
		//private static int[] lazy;
		//private static int cnt=0;
		private static int[] arr1;
		private static int[] arr;
		private static int k;
		private static LinkedList<Integer>[] l; 
		private static void soln(){
			int n=nextInt();
			HashSet<Integer>[] arr=new HashSet[n+1];
			arr[0]=new HashSet();
			int[] cnt=new int[n+1];
			cnt[0]=0;
			for(int i=1;i<=n;i++){
				cnt[i]=1;
				int max=1;
				int tmp=0;
				for(int j=1;j<=i;j++){
					if(max <=(1+cnt[i-j]) && !arr[i-j].contains(j)){
						max=1+cnt[i-j];
						tmp=i-j;
					}
					cnt[i]=max;
					arr[i]=new HashSet();
					for(int x:arr[tmp]){
						arr[i].add(x);
					}
					arr[i].add(i-tmp);
				}
			}
			pw.println(cnt[n]);
			for(int x:arr[n]){
				pw.print(x+" ");
			}
		}
		private static void solution(int[] arr){
			int n=arr.length;
			int[] l=new int[n];
			int[] r=new int[n];
			l[0]=0;
			Stack<Integer> s=new Stack();
			s.push(0);
			for(int i=1;i<n;i++){
				int h=arr[i];
				while(!s.isEmpty() && arr[s.peek()]<h){
					s.pop();
				}
				if(s.isEmpty())
					l[i]=0;
				else
					l[i]=s.peek();
				s.push(i);
			}
			s.clear();
			r[n-1]=n-1;
			s.push(n-1);
			for(int i=n-2;i>=0;i--){
				int h=arr[i];
				while(!s.isEmpty() && arr[s.peek()]<h)
					s.pop();
				if(s.isEmpty())
					r[i]=n-1;
				else
					r[i]=s.peek();
				s.push(i);
			}
			int max=-1;
			int ind=-1;
			for(int i=0;i<n;i++){
				long x=r[i]-l[i];
				int ans=(int) ((((x*x)%mod)*((long)i+1))%mod);
				//pw.println(arr[l[i]]+" "+arr[r[i]]+" "+(i+1)+" "+ans);
				if(max<ans){
					max=ans;
					ind=i+1;
				}
			}
			pw.println(ind);
		}
		private static int count(int a){
			int cnt=0;
			while(a!=0){
				cnt+=a%2;
				a=a/2;
			}
			return cnt;
		}
		private static void dfs1(int cur,int prev){
			int xor=0;
			Iterator<Integer> i=l[cur].listIterator();
			while(i.hasNext()){
				int j=i.next();
				if(j!=prev){
					xor^=arr[j];
					dfs1(j,cur);
				}
			}
			cnt+=count(xor);
			if(cur==k-1)
				cnt+=(xor^arr[k-1]);
		}
		public static void sort(int inputArr[]) {
	        int length = inputArr.length;
	        doMergeSort(inputArr,0, length - 1);
	    }
	 
	    private static void doMergeSort(int[] arr,int lowerIndex, int higherIndex) {         
	        if (lowerIndex < higherIndex) {
	            int middle = lowerIndex + (higherIndex - lowerIndex) / 2;
	            doMergeSort(arr,lowerIndex, middle);
	            doMergeSort(arr,middle + 1, higherIndex);
	            mergeParts(arr,lowerIndex, middle, higherIndex);
	        }
	    }
	    private static void mergeParts(int[]array,int lowerIndex, int middle, int higherIndex) {
	    	int[] temp=new int[higherIndex-lowerIndex+1];
	        for (int i = lowerIndex; i <= higherIndex; i++) {
	            temp[i-lowerIndex] = array[i];
	        }
	        int i = lowerIndex;
	        int j = middle + 1;
	        int k = lowerIndex;
	        while (i <= middle && j <= higherIndex) {
	            if (temp[i-lowerIndex] < temp[j-lowerIndex]) {
	                array[k] = temp[i-lowerIndex];
	                i++;
	            } else {
	                array[k] = temp[j-lowerIndex];
	                j++;
	                cnt+=(middle+1-i);
	            }
	            k++;
	        }
	        while (i <= middle) {
	            array[k] = temp[i-lowerIndex];
	            k++;
	            i++;
	        }
	        while(j<=higherIndex){
	        	array[k]=temp[j-lowerIndex];
	        	k++;
	        	j++;
	        }
	        /*pw.println(lowerIndex+" "+higherIndex);
	        for(int m=lowerIndex;m<=higherIndex;m++)
	        	pw.print(array[m]+" ");
	        pw.println();*/
	    }

		private static void multiply(int A[][],int[][] B){
			int[][] mul=new int[3][3];
			for(int i=0;i<3;i++)
				for(int j=0;j<3;j++){
					mul[i][j]=0;
					for(int k=0;k<3;k++)
						mul[i][j]=(mul[i][j]+(A[i][k]*B[k][j])%2)%2;
				}
			for(int i=0;i<3;i++){
				for(int j=0;j<3;j++){
					A[i][j]=mul[i][j];
					System.out.print(A[i][j]+" ");
				}
				System.out.println();
			}
			System.out.println();
		}
		private static int LCA(int u,int v,int[] depth,int lg){
			if(depth[u]<depth[v])
				return LCA(v,u,depth,lg);
			int diff=depth[u]-depth[v];
			for(int i=0;i<lg;i++)
				if(((diff>>i)&1)==1)
					u=pa[u][i];
			if(u!=v){
				for(int i=lg-1;i>=0;i--)
					if(pa[u][i]!=pa[v][i]){
						u=pa[u][i];
						v=pa[v][i];
					}
				u=pa[u][0];
			}
			return u;
		}
		private static class node{
			private int count;
			private node left;
			private node right;
			public node(int cnt,node a,node b){
				count=cnt;
				left=a;
				right=b;
			}
			public node insert(int l,int r,int w){
				if(l<=w && w<r){
					if(l+1<=r)
						return new node(count+1,null,null);
					int m=(l+r)>>1;
					return new node(count+1,left.insert(l, m, w),right.insert(m, r, w));
				}
				return this;
			}
		}
		private static void method(int index,int n,LinkedList<Long>[] list,long x,int[] cnt){
			if(index==n){
				pw.print(x+" ");
				return;
			}
			Iterator<Long> i;
			if(cnt[index]==1)
				i=list[index].descendingIterator();
			else
				i=list[index].listIterator();
			while(i.hasNext()){
				long y=i.next();
				method(index+1,n,list,x*y,cnt);
				if(cnt[index+1]==1)
					cnt[index+1]=0;
				else
					cnt[index+1]=1;
			}
		}
		private static void bfs(int v,LinkedList<Integer>[] graph,int[] val,int n){
			boolean[] visited=new boolean[n];
			visited[v]=true;
			Queue<Integer> q=new PriorityQueue();
			q.add(v);
			while(!q.isEmpty()){
				int a=q.poll();
				int flag=(val[a]==1)?0:1;
				Iterator<Integer> i=graph[a].iterator();
				while(i.hasNext()){
					int j=i.next();
					if(!visited[j]){
						visited[j]=true;
						q.add(j);
						val[j]=flag;
					}
					if(visited[j] && flag==0)
						val[j]=0;
					//System.out.println(j+" "+flag);
				}
			}
		}
		private static class tmp implements Comparable<tmp>{
			private long x;
			private long y;
			public tmp(long x,long y){
				this.x=x;
				this.y=y;
			}
			@Override
			public int compareTo(tmp o) {
				return (int) (this.x-o.x);
			}
			
		}
		private static class temp implements Comparable<temp>{
			private int x;
			private LinkedList<Integer> list;
			public temp(int a){
				x=a;
				list=new LinkedList();
			}
			@Override
			public int compareTo(temp arg0) {
				return this.x-arg0.x;
			}
		}
		private static class Segment{
			//private int[] base;
			private int[] tree;
			private int size;
			private int n;
			private class node{
				private int a;
				private int b;
				private int c;
				public node(int x,int y,int z){
					a=x;
					b=y;
					c=z;
				}
			}
			public Segment(int n){
				//this.base=arr;
				int x = (int) (Math.ceil(Math.log(n) / Math.log(2)));
		        size = 2 * (int) Math.pow(2, x) - 1;
				tree=new int[size];
				this.n=n;
				//build(0,0,n-1);
			}
			private void build(int id,int l,int r){
				//pw.println(1);
				if(r==l){
					tree[id]=1;
					return;
				}
				int mid=l+(r-l)/2;
				//System.out.println(2*id+1+" "+l+" "+mid);
				build(2*id+1,l,mid);
				//System.out.println(2*id+2+" "+(mid+1)+" "+r);
				build(2*id+2,mid+1,r);
				tree[id]=tree[2*id+1]+tree[2*id+2];
			}
			public int query(int l,int r){
				return queryUtil(l,r,0,0,n-1);
			}
			private int queryUtil(int x,int y,int id,int l,int r){
				if(l>y || x>r) 
					return 0;
				if(x <= l && r<=y)
					return tree[id];
				int mid=l+(r-l)/2;
				return queryUtil(x,y,2*id+1,l,mid)+queryUtil(x,y,2*id+2,mid+1,r);
			}
			public void print(){
				HashSet<Integer> set=new HashSet<Integer>();
				cnt(0,0,n-1,set);
				pw.println(set.size());
			}
			private void cnt(int id,int l,int r,HashSet<Integer> set){
				if(tree[id]!=0){
					set.add(tree[id]);
					return;
				}
				if(r==l)
					return;
				int mid=l+(r-l)/2;
				cnt(2*id+1,l,mid,set);
				cnt(2*id+2,mid+1,r,set);
			}
			public void update(int x,int y,int colour,int id,int l,int r){
				if(x>r || l>y)
					return;
				if(x<=l && r<=y){
					tree[id]=colour;
					return;
				}
				int mid=l+(r-l)/2;
				shift(id);
				update(x,y,colour,2*id+1,l,mid);
				update(x,y,colour,2*id+2,mid+1,r);
				//tree[id]=tree[2*id+1]+tree[2*id+2];
			}
			private void shift(int id){
				if(tree[id]!=0){
					tree[2*id+1]=tree[2*id+2]=tree[id];
				}
				tree[id]=0;
			}
		}
		private static String solve(long a,long b){
	        long x = 0, y = 1, lastx = 1, lasty = 0, temp;
	        while (b != 0){
	            long q = a / b;
	            long r = a % b;
	            a = b;
	            b = r;
	            temp = x;
	            x = lastx - q * x;
	            lastx = temp;
	            temp = y;
	            y = lasty - q * y;
	            lasty = temp;            
	        }
	        return new String(lastx+" "+lasty);
		}
		private static long power(long x,long y,long m){
			if(y==0)
				return 1;
			long p=power(x,y/2,m)%m;
			p=(p*p)%m;
			return (y%2==0)?p:(x*p)%m;
		}
		private static boolean isPrime(int n){
			if(n%2==0 || n%3==0)
				return false;
			for(int i=5;i*i<=n;i+=6)
				if(n%i==0 || n%(i+2)==0)
					return false;
			return true;
					
		}
		private static void DFS(int cur,int prev,int[] depth,int[] val,LinkedList<Integer>[] list,int parent[]){
			//System.out.println(v);
			pa[cur][0]=prev;
			parent[cur]=prev;
			depth[cur]=(prev==-1)?0:depth[prev]+1;
			Iterator<Integer> i=list[cur].listIterator();
			while(i.hasNext()){
				int x=i.next();
				if(x!=prev)
					DFS(x,cur,depth,val,list,parent);
			}
		}
		private static long gcd(long n,long r){
			if(r==0)
				return n;
			else return gcd(r,n%r);
		}
	
		private static long min(long a,long b){
			if(a>b)
				return b;
			else
				return a;
		}
		private static class Pair implements Comparable<Pair>{
			int x;
			int y;
			public Pair(int a,int b){
				x=a;
				y=b;
			}
			@Override
			public int compareTo(Pair arg0) {
				if(this.x > arg0.x)
					return 1;
				return 0;
			}
		}
		private static long pow(int a, BigInteger b, int MOD) {
			long x = 1, y = a;
			    while(b.compareTo(new BigInteger("0"))==1) {
			        if(b.mod(new BigInteger("2")).intValue() == 1) {
			            x=(x*y);
			            if(x>MOD) x%=MOD;
			        }
			        y = (y*y);
			        if(y>MOD) y%=MOD;
			        b =b.divide(new BigInteger("2"));
			    }
			    return x;
			}
		private static void computeLpsArray(String pat,int size,int[] lps){
			int len=0;
			int i=1;
			lps[0]=0;
			while(i<size){
				if(pat.charAt(i)==pat.charAt(len)){
					len++;
					lps[i]=len;
					i++;
				}else{
					if(len!=0){
						len=lps[len-1];
					}else{
						lps[i]=len;
						i++;
					}
				}
			}
		}
		private static int KMP(String pat,String txt){
			int m=pat.length();
			int n=txt.length();
			int[] lps=new int[m];
			int j=0;
			int len=0;
			int index=0;
			computeLpsArray(pat,m,lps);
			int i=0;
			while(i<n){
				if(pat.charAt(j)==txt.charAt(i)){
					i++;
					j++;
				}else{
					if(j!=0)
						j=lps[j-1];
					else
						i++;
				}
				if(len<j){
					len=j;
					//pw.println(i);
					index=i;
				}
			}
			return index-len;
		}
		private static long max(long a,long b){
			if(a>b)
				return a;
			return b;
		}
		public static void main(String[] args) throws Exception {
			InputReader(System.in);
			pw = new PrintWriter(System.out);
			soln();
			pw.close();
		}
	
		// To Get Input
		// Some Buffer Methods
	
		public static void InputReader(InputStream stream1) {
			stream = stream1;
		}
	
		private static boolean isWhitespace(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	
		private static boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
	
		private static int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
	
		private static int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
	
		private static long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
	
		private static String nextToken() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}
	
		private static String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}
	
		private static int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}
	
		private static long[] nextLongArray(int n) {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}
	
		private static void pArray(int[] arr) {
			for (int i = 0; i < arr.length; i++) {
				System.out.print(arr[i] + " ");
			}
			System.out.println();
			return;
		}
	
		private static void pArray(long[] arr) {
			for (int i = 0; i < arr.length; i++) {
				System.out.print(arr[i] + " ");
			}
			System.out.println();
			return;
		}
	
		private static boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return isWhitespace(c);
		}
	
		private interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	
	}