Problem: You are given a deck of n cards numbered from 1 to n (not necessarily in this order in the deck). You have to sort the deck by repeating the following operation. 

  * Choose 2 ≤ k ≤ n and split the deck in k nonempty contiguous parts D_1, D_2,..., D_k (D_1 contains the first |D_1| cards of the deck, D_2 contains the following |D_2| cards and so on). Then reverse the order of the parts, transforming the deck into D_k, D_{k-1}, ..., D_2, D_1 (so, the first |D_k| cards of the new deck are D_k, the following |D_{k-1}| cards are D_{k-1} and so on). The internal order of each packet of cards D_i is unchanged by the operation. 



You have to obtain a sorted deck (i.e., a deck where the first card is 1, the second is 2 and so on) performing at most n operations. It can be proven that it is always possible to sort the deck performing at most n operations.

Examples of operation: The following are three examples of valid operations (on three decks with different sizes). 

  * If the deck is [3 6 2 1 4 5 7] (so 3 is the first card and 7 is the last card), we may apply the operation with k=4 and D_1=[3 6], D_2=[2 1 4], D_3=[5], D_4=[7]. Doing so, the deck becomes [7 5 2 1 4 3 6]. 
  * If the deck is [3 1 2], we may apply the operation with k=3 and D_1=[3], D_2=[1], D_3=[2]. Doing so, the deck becomes [2 1 3]. 
  * If the deck is [5 1 2 4 3 6], we may apply the operation with k=2 and D_1=[5 1], D_2=[2 4 3 6]. Doing so, the deck becomes [2 4 3 6 5 1]. 

Input

The first line of the input contains one integer n (1≤ n≤ 52) — the number of cards in the deck.

The second line contains n integers c_1, c_2, ..., c_n — the cards in the deck. The first card is c_1, the second is c_2 and so on.

It is guaranteed that for all i=1,...,n there is exactly one j∈\{1,...,n\} such that c_j = i.

Output

On the first line, print the number q of operations you perform (it must hold 0≤ q≤ n).

Then, print q lines, each describing one operation.

To describe an operation, print on a single line the number k of parts you are going to split the deck in, followed by the size of the k parts: |D_1|, |D_2|, ... , |D_k|. 

It must hold 2≤ k≤ n, and |D_i|≥ 1 for all i=1,...,k, and |D_1|+|D_2|+⋅⋅⋅ + |D_k| = n.

It can be proven that it is always possible to sort the deck performing at most n operations. If there are several ways to sort the deck you can output any of them.

Examples

Input


4
3 1 2 4


Output


2
3 1 2 1
2 1 3


Input


6
6 5 4 3 2 1


Output


1
6 1 1 1 1 1 1


Input


1
1


Output


0

Note

Explanation of the first testcase: Initially the deck is [3 1 2 4]. 

  * The first operation splits the deck as [(3) (1 2) (4)] and then transforms it into [4 1 2 3]. 
  * The second operation splits the deck as [(4) (1 2 3)] and then transforms it into [1 2 3 4]. 

Explanation of the second testcase: Initially the deck is [6 5 4 3 2 1]. 

  * The first (and only) operation splits the deck as [(6) (5) (4) (3) (2) (1)] and then transforms it into [1 2 3 4 5 6]. 

Solution (in JAVA):

Solution:
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.concurrent.TimeUnit;

public class d1429 implements Runnable{
	
    public static void main(String[] args) {
    	try{
            new Thread(null, new d1429(), "process", 1<<26).start();
        }
        catch(Exception e){
            System.out.println(e);
        }
    }
	public void run() {
		FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		//PrintWriter out = new PrintWriter("file.out");
		Task solver = new Task();
		//int t = scan.nextInt();
		int t = 1;
		for(int i = 1; i <= t; i++) solver.solve(i, scan, out);
		out.close();
	}

	static class Task {
		static final int oo = Integer.MAX_VALUE;
		static final long OO = Long.MAX_VALUE;
		
		public void solve(int testNumber, FastReader sc, PrintWriter out) {
			int N = sc.nextInt();
			int[] arr = sc.readArray(N);
			int[] clone = new int[N];
			for(int i = 0; i < N; i++) {
				clone[i] = arr[i];
			}
			sort(clone);
			
			List<List<Integer>> ans = new ArrayList<>();
			for(int i = 0; i <= N; i++) {
				ans.add(new ArrayList<>());
			}
			
			for(int lo = 1, hi = N+1; lo <= N/2; hi--) {
				if(Arrays.equals(clone, arr)) {
					break;
				}
				for(int i = 1; i < lo; i++) {
					ans.get(lo).add(1);
				}
				
				for(int i = 0; i < N; i++) {
					if(arr[i] == lo) {
						ans.get(lo).add(i - lo+1);
						ans.get(lo).add(hi - i - 1);
						
						arr = swap(lo-1, i, hi-2, arr);
						break;
					}
				}
				
				for(int i = hi; i <= N; i++) {
					ans.get(lo).add(1);
				}
				
//				dbg(arr);
				if(Arrays.equals(clone, arr)) {
					break;
				}
				
				lo++;
				for(int i = 1; i < lo; i++) {
					ans.get(hi-1).add(1);
				}
				
				for(int i = 0; i < N; i++) {
					if(arr[i] == hi-1) {
						ans.get(hi-1).add(i - lo + 1);
						ans.get(hi-1).add(hi - i - 1);
						
						arr = swap2(lo-1, i, hi-2, arr);
						break;
					}
				}
				
				for(int i = hi; i <= N; i++) {
					ans.get(hi-1).add(1);
				}
				
//				dbg(arr);
			}
			
//			dbg(ans);
			
			for(List<Integer> each: ans) {
				while(each.contains(0))
					each.remove((Integer)0);
			}
			
//			dbg(ans);
			
			int count = 0;
			StringBuilder sb = new StringBuilder("");
			for(int i = 1; i <= N/2; i++) {
				if(ans.get(i).size() >= 2) {
					count++;
					sb.append(ans.get(i).size() + " ");
					for(int each: ans.get(i))
						sb.append(each + " ");
					sb.append("\n");
				}
				if(ans.get(N-i+1).size() >= 2) {
					count++;
					sb.append(ans.get(N-i+1).size() + " ");
					for(int each: ans.get(N-i+1))
						sb.append(each + " ");
					sb.append("\n");
				}
			}
			
			if(!Arrays.equals(clone, arr)) {
				count++;
				sb.append(N + " ");
				for(int i = 1; i <= N; i++) {
					sb.append(1 + " ");
				}
				sb.append("\n");
			}
			
			out.println(count);
			out.println(sb);
		}
		
		int[] swap2(int start, int mid, int end, int[] arr) { // mid is included in the end
			int[] noo = new int[arr.length];
			for(int i = 0; i < start; i++) {
				noo[arr.length-i-1] = arr[i];
				noo[i] = arr[arr.length-i-1];
			}
			int i = mid;
			int j = start-1;
			
			for(; i <= end; i++, j++) {
				noo[j] = arr[i];
			}
			
			i = start;
			for(; i < mid; i++, j++) {
				noo[j] = arr[i];
			}
			return noo;
		}
		
		int[] swap(int start, int mid, int end, int[] arr) { // mid is included in the end
			int[] noo = new int[arr.length];
			for(int i = 0; i < start; i++) {
				noo[i] = arr[arr.length - i - 1];
				noo[arr.length-i-1] = arr[i];
			}
			int i = mid;
			int j = start;
			
			for(; i <= end; i++, j++) {
				noo[j] = arr[i];
			}
			
			i = start;
			for(; i < mid; i++, j++) {
				noo[j] = arr[i];
			}
			return noo;
		}
	}
	
	
	static long modInverse(long N, long MOD) {
		return binpow(N, MOD - 2, MOD);
	}
	static long modDivide(long a, long b, long MOD) {
		a %= MOD;
		return (binpow(b, MOD-2, MOD) * a) % MOD;
	}
	static long binpow(long a, long b, long m) {
		a %= m;
		long res = 1;
		while (b > 0) {
			if ((b & 1) == 1)
				res = res * a % m;
			a = a * a % m;
			b >>= 1;
		}
		return res;
	}
	static int[] reverse(int a[]) 
    { 
        int[] b = new int[a.length]; 
        for (int i = 0, j = a.length; i < a.length; i++, j--) { 
            b[j - 1] = a[i]; 
        } 
        
        return b;
    }
	static long[] reverse(long a[]) 
    { 
        long[] b = new long[a.length]; 
        for (int i = 0, j = a.length; i < a.length; i++, j--) { 
            b[j - 1] = a[i]; 
        } 
        
        return b;
    }
	
	static void shuffle(int[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			int temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}
	
	static void sort(int[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	
	static class tup implements Comparable<tup>, Comparator<tup>{
		int a, b;
		tup(int a,int b){
			this.a=a;
			this.b=b;
		}
		public tup() {
		}
		@Override
		public int compareTo(tup o){
			return Integer.compare(b,o.b);
		}
		@Override
		public int compare(tup o1, tup o2) {
			return Integer.compare(o1.b, o2.b);
		}
		
		@Override
	    public int hashCode() {
			return Objects.hash(a, b);
	    }
 
	    @Override
	    public boolean equals(Object obj) {
	    	if (this == obj)
                return true;
	    	if (obj == null)
                return false;
	    	if (getClass() != obj.getClass())
                return false;
	    	tup other = (tup) obj;
	    	return a==other.a && b==other.b;
	    }
	    
	    @Override
	    public String toString() {
	    	return a + " " + b;
	    }
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
		
		int[] readArray(int size) {
			int[] a = new int[size];
			for(int i = 0; i < size; i++) {
				a[i] = nextInt();
			}
			return a;
		}
		
		long[] readLongArray(int size) {
			long[] a = new long[size];
			for(int i = 0; i < size; i++) {
				a[i] = nextLong();
			}
			return a;
		}
	}
	
	static void dbg(int[] arr) {
		System.out.println(Arrays.toString(arr));
	}
	static void dbg(long[] arr) {
		System.out.println(Arrays.toString(arr));
	}
	static void dbg(boolean[] arr) {
		System.out.println(Arrays.toString(arr));
	}

	static void dbg(Object... args) {
        for (Object arg : args)
            System.out.print(arg + " ");
        System.out.println();
    }
}