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.util.*;

public class Main {
    static PrintWriter pw;
    static Scanner sc;
    static long ceildiv(long x, long y) { return y==0?inf:(x+y-1)/y; }
    static int mod(long x, int m) { return (int)((x%m+m)%m); }
    static void put(TreeMap<Integer, Integer> map, Integer p){if(map.containsKey(p)) map.replace(p, map.get(p)+1); else map.put(p, 1); }
    static void rem(TreeMap<Integer, Integer> map, Integer p){ if(map.get(p)==1) map.remove(p);else map.replace(p, map.get(p)-1); }
    static void printf(double x, int dig){ String s="%."+dig+"f"; pw.printf(s, x); }
    static long gcd(long x, long y) {return y==0?x:gcd(y, x%y);}
    static int Int(boolean x){ return x?1:0; }
    static final int inf=(int)2e9, mod=inf+7;
    static boolean[] visit;
    static ArrayList<Integer>[] adj;
    static int[] h;
    static ArrayList<ArrayList<Integer>> out;
    static final double r2=Math.sqrt(2), eps=1e-12;
    public static void main(String[] args) throws IOException {
        sc=new Scanner(System.in);
        pw=new PrintWriter(System.out);
        int n=sc.nextInt(), arr[]=sc.nextArr(n);
        if(n==1){
            pw.println(0);
            pw.close();
            return;
        }
        int idx=-1;
        for(int i=0; i<n && idx==-1; i++){
            if(i+1==arr[i])
                idx=i;
        }
        boolean right=true;
        out=new ArrayList<>();
        for(int i=n, done=0; i>0; i--, done++){
            int temp=out.size();
            right=solve(i, arr, right, done);
            if(out.size()>temp)
                change(arr);
        }
        if(rev(arr)){
            ArrayList<Integer> list=new ArrayList<>();
            for(int i=0; i<n; i++)
                list.add(1);
            out.add(list);
        }
        int c=0;
        for(int i=0; i<out.size(); i++){
            if(out.get(i).size()==1)
                continue;
            c++;
        }
        pw.println(c);
        for(int i=0; i<out.size(); i++) {
            if (out.get(i).size() == 1)
                continue;
            pw.print(out.get(i).size()+" ");
            printArr(out.get(i));
        }
        pw.close();
    }
    static boolean rev(int[] arr){
        return arr[1]<arr[0];
    }
    static void change(int[] arr){
        ArrayList<Integer> list=out.get(out.size()-1);
        ArrayList<int[]> ans=new ArrayList<>();
        int idx=0;
        for(int x: list){
            int[] a=new int[x];
            for(int i=0; i<x; i++)
                a[i]=arr[idx+i];
            idx+=x;
            ans.add(a);
        }
        int i=ans.size()-1, j=0;
        for(int k=0; k<arr.length; k++){
            if(ans.get(i).length==j){
                j=0;
                i--;
            }
            arr[k]=ans.get(i)[j++];
        }
    }
    static boolean solve(int x, int[] arr, boolean r, int d){
        if((arr[x-1]==x && r) || (arr[arr.length-x]==x && !r))
            return r;
        ArrayList<Integer> ans=new ArrayList<>();
        if(!r){
            for(int i=0; i<d; i++)
                ans.add(1);
            for(int i=d; i<arr.length; i++){
                if(arr[i]==x){
                    int y=i-d+1;
                    ans.add(y);
                    if(y!=arr.length-d) ans.add(arr.length-d-y);
                }
            }
        }else{
            for(int i=0; i<arr.length-d; i++){
                if(arr[i]==x){
                    if(i>0) ans.add(i);
                    ans.add(arr.length-d-i);
                }
            }
            for(int i=arr.length-d; i<arr.length; i++)
                ans.add(1);
        }
        out.add(ans);
        return !r;
    }
    static int dist(Pair a, Pair b){
        return Math.abs(a.x-b.x)+Math.abs(a.y-b.y);
    }
    static void printArr(int[] arr) {
        for (int i = 0; i < arr.length - 1; i++)
            pw.print(arr[i] + " ");
        pw.println(arr[arr.length - 1]);
    }
    static void printArr(long[] arr) {
        for (int i = 0; i < arr.length - 1; i++)
            pw.print(arr[i] + " ");
        pw.println(arr[arr.length - 1]);
    }
    static void printArr(Integer[] arr) {
        for (int i = 0; i < arr.length; i++)
            pw.print(arr[i] + " ");
        pw.println();
    }
    static void printArr(char[] arr) {
        for (int i = 0; i < arr.length; i++)
            pw.print(arr[i]==0? '1': arr[i]);
        pw.println();
    }
    static void printArr(ArrayList<Integer> list) {
        for (int i = 0; i < list.size(); i++)
            pw.print(list.get(i)+" ");
        pw.println();
    }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;
        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

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

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

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
        public int[] nextDigits() throws IOException{
            String s=nextLine();
            int[] arr=new int[s.length()];
            for(int i=0; i<arr.length; i++)
                arr[i]=s.charAt(i)-'0';
            return arr;
        }
        public int[] nextArr(int n) throws IOException {
            int[] arr = new int[n];
            for (int i = 0; i < arr.length; i++)
                arr[i] = nextInt();
            return arr;
        }
        public Integer[] nextsort(int n) throws IOException{
            Integer[] arr=new Integer[n];
            for(int i=0; i<n; i++)
                arr[i]=nextInt();
            return arr;
        }
        public Pair nextPair() throws IOException{
            return new Pair(nextInt(), nextInt());
        }
        public Pair[] nextPairArr(int n) throws IOException{
            Pair[] arr=new Pair[n];
            for(int i=0; i<n; i++)
                arr[i]=nextPair();
            return arr;
        }
        public boolean ready() throws IOException {
            return br.ready();
        }
    }
    static class Pair implements Comparable<Pair>{
        int x;
        int y;
        public Pair(int x, int y) {
            this.x=x;
            this.y=y;
        }
        public int hashCode() {
            return (this.x*1000+this.y);
        }
        public int compareTo(Pair p){
            return x-p.x;
        }
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (this.getClass() != obj.getClass()) {
                return false;
            }
            Pair p = (Pair) obj;
            return this.x==p.x && this.y==p.y;
        }
        public Pair clone(){
            return new Pair(x, y);
        }
        public String toString(){
            return this.x+" "+this.y;
        }
        public void add(Pair p){
            x+=p.x;
            y+=p.y;
        }
    }
    static class node{
        node rc, lc;
        int val;
        int size;
        public node(int x){
            val=x;
            size=1;
        }
        void add(int x){
            if(x>val){
                if(rc==null){
                    rc=new node(x);
                    size++;
                }else{
                    rc.add(x);
                }
            }else if(x<val){
                if(lc==null){
                    lc=new node(x);
                    size++;
                }else{
                    lc.add(x);
                }
            }
        }
        void print(){
            if(lc!=null)
                lc.print();
            pw.println(val);
            if(rc!=null)
                rc.print();
        }
        boolean contains(int x){
            if(x==val)
                return true;
            if(x<val)
                return lc==null?false:lc.contains(x);
            return rc==null?false: rc.contains(x);
        }
    }
    static class Tree{
        node head;
        public Tree(){ ;}
        void add(int x){
            if(head==null){
                head=new node(x);
                return;
            }
            head.add(x);
        }
        void print(){
            if(head!=null)
                head.print();
        }
        boolean contains(int x){
            return head==null? false: head.contains(x);
        }
    }
}