Problem: You are given a sequence a1, a2, ..., an consisting of different integers. It is required to split this sequence into the maximum number of subsequences such that after sorting integers in each of them in increasing order, the total sequence also will be sorted in increasing order.

Sorting integers in a subsequence is a process such that the numbers included in a subsequence are ordered in increasing order, and the numbers which are not included in a subsequence don't change their places.

Every element of the sequence must appear in exactly one subsequence.

Input

The first line of input data contains integer n (1 ≤ n ≤ 105) — the length of the sequence.

The second line of input data contains n different integers a1, a2, ..., an ( - 109 ≤ ai ≤ 109) — the elements of the sequence. It is guaranteed that all elements of the sequence are distinct.

Output

In the first line print the maximum number of subsequences k, which the original sequence can be split into while fulfilling the requirements.

In the next k lines print the description of subsequences in the following format: the number of elements in subsequence ci (0 < ci ≤ n), then ci integers l1, l2, ..., lci (1 ≤ lj ≤ n) — indices of these elements in the original sequence. 

Indices could be printed in any order. Every index from 1 to n must appear in output exactly once.

If there are several possible answers, print any of them.

Examples

Input

6
3 2 1 6 5 4


Output

4
2 1 3
1 2
2 4 6
1 5


Input

6
83 -75 -49 11 37 62


Output

1
6 1 2 3 4 5 6

Note

In the first sample output:

After sorting the first subsequence we will get sequence 1 2 3 6 5 4.

Sorting the second subsequence changes nothing.

After sorting the third subsequence we will get sequence 1 2 3 4 5 6.

Sorting the last subsequence changes nothing.

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;
import java.util.function.IntConsumer;
import java.util.stream.Stream;

public class Solution {


    static MyScanner sc;
    private static PrintWriter out;
    static long M2 = 1_000_000_000L + 7;

    private static HashMap<Long, Long>[] mods;

    public static void main(String[] s) throws Exception {
        StringBuilder stringBuilder = new StringBuilder();
//        stringBuilder.append("7 3\n" +
//                "1 5 2 6 3 7 4\n" +
//                "2 5 3\n" +
//                "4 4 1\n" +
//                "1 7 3");

//
//        Random r = new Random(5);
//        stringBuilder.append("100000 5000 ");
//        for (int i = 0; i < 100000; i++) {
//            stringBuilder.append(" " + (r.nextInt(2000000000) - 1000000000) + " ");
//
//        }
//        for (int k = 0; k < 5000; k++) {
//            stringBuilder.append(" 1 100000 777 ");
//        }

        if (stringBuilder.length() == 0) {
            sc = new MyScanner(System.in);
        } else {
            sc = new MyScanner(new BufferedReader(new StringReader(stringBuilder.toString())));
        }

        out = new PrintWriter(new OutputStreamWriter(System.out));

        initData();
        solve();
        out.flush();
    }


    private static void initData() {


    }

    private static void solve() throws IOException {
        int n = sc.nextInt();
        int[] data = sc.na(n);
        int[] t = Arrays.copyOf(data, n);
        HashMap<Integer, Integer> ind = new HashMap<>();
        for (int i = 0; i < n; i++) {
            ind.put(data[i], i);
        }
        Arrays.sort(t);
        List<List<Integer>> dat = new ArrayList<>();
        boolean[] v = new boolean[n];
        for (int k = 0; k < n; k++) {
            if (v[k]) continue;
            v[k] = true;
            List<Integer> cur = new ArrayList<>();
            dat.add(cur);
            cur.add(k + 1);
            int x = ind.get(t[k]);

            while (x != k) {
                v[x] = true;
                cur.add(x + 1);
                x = ind.get(t[x]);
            }
        }
        out.println(dat.size());
        for (List<Integer> v1 : dat) {
            out.print(v1.size() + " ");
            for (int lll : v1) {
                out.print(lll + " ");
            }
            out.println();
        }
    }

    private static final class AList {
        int[] data;
        int c = 0;

        public AList(int n) {
            this.data = new int[Math.max(Integer.highestOneBit(n - 1) << 1, 4)];
        }

        public AList() {
            this(4);
        }

        public AList(int[] data) {
            this(data.length);
            System.arraycopy(data, 0, this.data, 0, data.length);
        }

        public void sort() {
            if (c < 2) return;
            Arrays.sort(data, 0, c);
        }

        public void work(IntConsumer intConsumer) {
            for (int i = 0; i < c; i++) {
                intConsumer.accept(data[i]);
            }
        }

        public void add(int k) {
            if (c == data.length) {
                data = Arrays.copyOf(data, data.length << 1);
            }
            data[c++] = k;
        }


    }

    private static final class SparseMatrix {
        AList[] init;

        public SparseMatrix(int n) {
            init = new AList[n + 1];
            for (int i = 1; i <= n; i++) {
                init[i] = new AList();
            }
        }

        void sort() {
            for (AList l : init) {
                if (l != null)
                    l.sort();
            }
        }

        public void add(int row, int column) {
            while (row < init.length) {
                init[row].add(column);
                row += row & (-row);
            }
        }


        private long sum(int x, int y) {
            if (x >= init.length) x = init.length - 1;
            long sum = 0;
            while (x > 0) {
                sum += r(x, y);
                x -= x & (-x);
            }
            return sum;
        }

        private long r(int x, int y) {
            return biSearch(init[x].data, 0, init[x].c, y);
        }
    }

    static int biSearch(int[] k, int from, int to, int val) {
        int r = Arrays.binarySearch(k, from, to, val + 1);
        if (r < 0) r = -r - 1;
        return r;
    }


    private static boolean isset(long i, int k) {
        return (i & (1 << k)) > 0;
    }

    private static void solveT() throws IOException {
        int t = sc.nextInt();
        while (t-- > 0) {
            solve();
        }
    }


    private static long gcd(long l, long l1) {
        if (l > l1) return gcd(l1, l);
        if (l == 0) return l1;
        return gcd(l1 % l, l);
    }

    private static long pow(long a, long b, long m) {
        if (b == 0) return 1;
        if (b == 1) return a;
        long pp = pow(a, b / 2, m);
        pp *= pp;
        pp %= m;
        return (pp * (b % 2 == 0 ? 1 : a)) % m;
    }


    static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        MyScanner(BufferedReader br) {
            this.br = br;
        }

        public MyScanner(InputStream in) {
            this(new BufferedReader(new InputStreamReader(in)));
        }

        void findToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }

        String next() {
            findToken();
            return st.nextToken();
        }

        Integer[] nab(int n) {
            Integer[] k = new Integer[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.fi();
            }
            return k;
        }

        int[] na(int n) {
            int[] k = new int[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.fi();
            }
            return k;
        }

        long[] nl(int n) {
            long[] k = new long[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.nextLong();
            }
            return k;
        }

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

        int fi() {
            String t = next();
            int cur = 0;
            boolean n = t.charAt(0) == '-';
            for (int a = n ? 1 : 0; a < t.length(); a++) {
                cur = cur * 10 + t.charAt(a) - '0';
            }
            return n ? -cur : cur;
        }

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

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


}