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.
import java.io.*;
import java.util.*;
 
 
public class TestClass{
	
	private static class Num
	{
		int oldIndex,newIndex;
		int val;
	}
	
	private static class Ans
	{
		LinkedList<Integer> list;
	}
	
	private static Print print;
	private static Scan scan;
		
	public static void main(String[] args) throws Exception{
		print=new Print();
		scan=new Scan();
		int n=scan.scanInt();
		Num arr1[]=new Num[n+1];
		Num arr2[]=new Num[n+1];
		arr1[0]=new Num();
		arr1[0].val=Integer.MIN_VALUE;
		arr2[0]=arr1[0];
		for(int i=1;i<=n;i++)
		{
			arr1[i]=new Num();
			arr1[i].val=scan.scanInt();
			arr1[i].oldIndex=i;
			arr2[i]=arr1[i];
		}
		Arrays.sort(arr1,MyComparator);
		for(int i=1;i<=n;i++)
			arr1[i].newIndex=i;
		int sum=0,temp=0;
		int u,v;
		Num num;
		LinkedList<Integer> list;
		ListIterator<Integer> itr;
		LinkedList<Ans> answers=new LinkedList<Ans>();
		Ans ans;
		boolean included[]=new boolean[n+1];
		for(int i=1;i<=n;i++)
		{
			if(!included[i])
			{
				if(arr1[i].oldIndex==arr1[i].newIndex)
				{
					list=new LinkedList<Integer>();
					list.add(i);
					ans=new Ans();
					ans.list=list;
					answers.add(ans);
				}
				else
				{
					sum=0;
					list=new LinkedList<Integer>();
					u=i;
					do
					{
						sum++;
						list.add(u);
						included[u]=true;
						num=arr2[u];
						arr2[u]=arr2[arr1[u].oldIndex];
						arr2[arr1[u].oldIndex]=num;
						arr2[arr1[u].oldIndex].oldIndex=arr1[u].oldIndex;
						num=arr2[arr1[u].oldIndex];
						arr2[u].oldIndex=arr1[u].newIndex;
						u=num.newIndex;
						if(arr1[u].newIndex==arr1[u].oldIndex)
						{
							list.add(u);
							included[u]=true;
							sum++;
						}
					}while(arr1[u].oldIndex!=arr1[u].newIndex);
					ans=new Ans();
					ans.list=list;
					answers.add(ans);
				}
			}
		}
		ListIterator<Ans> ansitr=answers.listIterator();
		print.printLine(Integer.toString(answers.size()));
		while(ansitr.hasNext())
		{
			ans=ansitr.next();
			print.print(Integer.toString(ans.list.size()));
			itr=ans.list.listIterator();
			while(itr.hasNext())
				print.print(" "+Integer.toString(itr.next()));
			print.printLine("");
		}
	}
	
	public static Comparator<Num> MyComparator= new Comparator<Num>()
	{
		@Override
		public int compare(Num n1, Num n2) 
		{
			if(n1.val>n2.val)
				return 1;
			else if(n1.val<n2.val)
				return -1;
			else
				return 0;
		}
	};
	
	
	
	private static class Scan
	{
		private byte[] buf=new byte[1024];
		private int index;
		private InputStream in;
		//private FileInputStream in;
		private int total;
		public Scan() throws Exception
		{
			in=System.in;
			//in=new FileInputStream("G:\\input.in");
		}
		public int scan()throws IOException
		{
			if(total<0)
			throw new InputMismatchException();
			if(index>=total)
			{
				index=0;
				total=in.read(buf);
				if(total<=0)
				return -1;
			}
			return buf[index++];
		}
		public long scanLong() throws IOException
		{
			long integer=0;
			int n=scan();
			while(isWhiteSpace(n))
			n=scan();
			int neg=1;
			if(n=='-')
			{
				neg=-1;
				n=scan();
			}
			while(!isWhiteSpace(n))
			{
				if(n>='0'&&n<='9')
				{
					integer*=10;
					integer+=n-'0';
					n=scan();
				}
				else throw new InputMismatchException();
			}
			return neg*integer;
		}
		public int scanInt()throws IOException
		{
			int integer=0;
			int n=scan();
			while(isWhiteSpace(n))
			n=scan();
			int neg=1;
			if(n=='-')
			{
				neg=-1;
				n=scan();
			}
			while(!isWhiteSpace(n))
			{
				if(n>='0'&&n<='9')
				{
					integer*=10;
					integer+=n-'0';
					n=scan();
				}
				else throw new InputMismatchException();
			}
			return neg*integer;
		}
		public double scanDouble()throws IOException
		{
			double doub=0;
			int n=scan();
			while(isWhiteSpace(n))
			n=scan();
			int neg=1;
			if(n=='-')
			{
				neg=-1;
				n=scan();
			}
			while(!isWhiteSpace(n)&&n!='.')
			{
				if(n>='0'&&n<='9')
				{
					doub*=10;
					doub+=n-'0';
					n=scan();
				}
				else throw new InputMismatchException();
			}
			if(n=='.')
			{
				n=scan();
				double temp=1;
				while(!isWhiteSpace(n))
				{
					if(n>='0'&&n<='9')
					{
						temp/=10;
						doub+=(n-'0')*temp;
						n=scan();
					}
					else throw new InputMismatchException();
				}
			}
			return doub*neg;
		}
		public String scanString()throws IOException
		{
			StringBuilder sb=new StringBuilder();
			int n=scan();
			while(isWhiteSpace(n))
			n=scan();
			while(!isWhiteSpace(n))
			{
				sb.append((char)n);
				n=scan();
			}
			return sb.toString();
		}
		private boolean isWhiteSpace(int n)
		{
			if(n==' '||n=='\n'||n=='\r'||n=='\t'||n==-1)
			return true;
			return false;
		}
	}
	
	private static class Print
	{
		private final OutputStream out;
		//private final FileOutputStream out;
		/*public Print(OutputStream outputStream)
		{
			writer=new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}*/
		public Print() throws Exception
		{
			this.out=System.out;
			//this.out=new FileOutputStream("G://output.txt");
		}
		public void print(String str)throws IOException
		{
			//buf=str.getBytes();
			for (int i = 0; i < str.length(); i++)
			{
				/*if (i != 0)
				out.write(' ');*/
				out.write(str.charAt(i));
			}
		}
		public void printLine(String str)throws IOException
		{
			print(str);
			//out.write('\n');
			out.write(System.getProperty("line.separator").getBytes());
		}
		public void close()throws IOException
		{
			out.close();
		}
	}
}