import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.Scanner;

public class B82 {

    static StreamTokenizer in;
    static PrintWriter out;

    static int nextInt() throws IOException {
        in.nextToken();
        return (int)in.nval;
    }

    static String nextString() throws IOException {
        in.nextToken();
        return in.sval;
    }

    public static void main(String[] args) throws IOException {
        in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);

        final int M = 200;

        n = nextInt();
        m = n*(n-1)/2;

        if (n == 2) {
            int k = nextInt();
            int[] a = new int[k];
            for (int i = 0; i < k; i++)
                a[i] = nextInt();
            out.println("1 " + a[0]);
            out.print(k-1);
            for (int i = 1; i < k; i++)
                out.print(" " + a[i]);
            out.println();
            out.flush();
            return;
        }

        cnt = new int[M][M];
        int[] s = new int[M];
        for (int i = 0; i < m; i++) {
            int k = nextInt();
            for (int j = 0; j < k; j++)
                s[j] = nextInt()-1;
            for (int j = 0; j < k; j++)
                for (int l = 0; l < j; l++) {
                    cnt[s[j]][s[l]]++;
                    cnt[s[l]][s[j]]++;
                }
        }

        {
            b = new boolean[M];
            for (int i = 0; i < M; i++) if (!b[i]) {
                boolean has = false;
                for (int j = 0; j < M && !has; j++) {
                    has |= cnt[i][j] > 0;
                }
                if (!has) {
                    b[i] = true;
                    continue;
                }
                c = new boolean[M];
                q = 0;
                go(i);
                out.print(q);
                for (int j = 0; j < M; j++)
                    if (c[j]) {
                        b[j] = true;
                        out.print(" " + (j+1));
                    }
                out.println();
            }
        }

        out.flush();
    }

    static final int M = 200;
    static int n, m, q;
    static int[][] cnt;
    static boolean[] b, c;

    static void go(int x) {
        c[x] = true;
        q++;
        for (int i = 0; i < M; i++)
            if (cnt[x][i] > 1 && !c[i])
                go(i);
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.Scanner;

public class B82 {

    static StreamTokenizer in;
    static PrintWriter out;

    static int nextInt() throws IOException {
        in.nextToken();
        return (int)in.nval;
    }

    static String nextString() throws IOException {
        in.nextToken();
        return in.sval;
    }

    public static void main(String[] args) throws IOException {
        in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);

        final int M = 200;

        n = nextInt();
        m = n*(n-1)/2;

        if (n == 2) {
            int k = nextInt();
            int[] a = new int[k];
            for (int i = 0; i < k; i++)
                a[i] = nextInt();
            out.println("1 " + a[0]);
            out.print(k-1);
            for (int i = 1; i < k; i++)
                out.print(" " + a[i]);
            out.println();
            out.flush();
            return;
        }

        cnt = new int[M][M];
        int[] s = new int[M];
        for (int i = 0; i < m; i++) {
            int k = nextInt();
            for (int j = 0; j < k; j++)
                s[j] = nextInt()-1;
            for (int j = 0; j < k; j++)
                for (int l = 0; l < j; l++) {
                    cnt[s[j]][s[l]]++;
                    cnt[s[l]][s[j]]++;
                }
        }

        {
            b = new boolean[M];
            for (int i = 0; i < M; i++) if (!b[i]) {
                boolean has = false;
                for (int j = 0; j < n && !has; j++) {
                    has |= cnt[i][j] > 0;
                }
                if (!has) {
                    b[i] = true;
                    continue;
                }
                c = new boolean[M];
                q = 0;
                go(i);
                out.print(q);
                for (int j = 0; j < M; j++)
                    if (c[j]) {
                        b[j] = true;
                        out.print(" " + (j+1));
                    }
                out.println();
            }
        }

        out.flush();
    }

    static final int M = 200;
    static int n, m, q;
    static int[][] cnt;
    static boolean[] b, c;

    static void go(int x) {
        c[x] = true;
        q++;
        for (int i = 0; i < M; i++)
            if (cnt[x][i] > 1 && !c[i])
                go(i);
    }
}


import java.io.*;
import java.util.*;

public class B{

        private BufferedReader in;
        private StringTokenizer st;

        void solve() throws IOException{

            int n = nextInt();
            HashSet<Integer>[]x = new HashSet[(n*(n-1))/2];
            for (int i = 0; i < x.length; i++) {
                x[i] = new HashSet<Integer>();
                int a = nextInt();
                for (int j = 0; j < a; j++) {
                    int y = nextInt();
                    x[i].add(y);
                }
            }
            if(x.length == 1){

                ArrayList<Integer> ans = new ArrayList<Integer>();
                for (Integer num : x[0]) {
                    ans.add(num);
                }
                System.out.println(1+" "+ans.get(0));
                System.out.print(ans.size()-1);
                for (int i = 1; i < ans.size(); i++) {
                    System.out.print(" "+ans.get(i));
                }
                System.out.println();
                return;
            }
            for (int i = 0;i<x.length;++i) {
                ArrayList<Integer> l = new ArrayList<Integer>();
                for (Integer num : x[i]) {
                    l.add(num);
                }
                if(l.size() == 0) continue;
                int ref = l.get(0);
//              System.out.println(ref);
                ArrayList<Integer> set1 = new ArrayList<Integer>();
                ArrayList<Integer> set2 = new ArrayList<Integer>();
                set1.add(ref);
                for (int j = 1; j < l.size(); j++) {
                    boolean found = true;
                    for (int k = i+1; k < x.length; k++) {
                        if( (x[k].contains(ref) && !x[k].contains(l.get(j) )) || (!x[k].contains(ref) && x[k].contains(l.get(j))) ){
                            set2.add(l.get(j));
                            found = false;
                            break;
                        }
                    }
                    if(found) set1.add(l.get(j));
                    for (int k = i+1; k < x.length; k++) {
                        x[k].remove(l.get(j));
//                      x[k].remove(ref);
                    }
                }
                for (int k = i+1; k < x.length; k++) {
                    x[k].remove(ref);
                }

                System.out.print(set1.size());
                for (int j = 0; j < set1.size(); j++) {
                    System.out.print(" "+set1.get(j));
                }
                System.out.println();
                if(set2.size()>0){
                    System.out.print(set2.size());
                    for (int j = 0; j < set2.size(); j++) {
                        System.out.print(" "+set2.get(j));
                    }
                    System.out.println();
                }

            }
        }

        B() throws IOException {
            in = new BufferedReader(new InputStreamReader(System.in));
            eat("");
            solve();
        }

        private void eat(String str) {
            st = new StringTokenizer(str);
        }

        String next() throws IOException {
            while (!st.hasMoreTokens()) {
                String line = in.readLine();
                if (line == null) {
                    return null;
                }
                eat(line);
            }
            return st.nextToken();
        }

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

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

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

        public static void main(String[] args) throws IOException {
            new B();
        }

        int gcd(int a,int b){
            if(b>a) return gcd(b,a);
            if(b==0) return a;
            return gcd(b,a%b);
        }

}


import java.io.*;
import java.util.*;

public class B{

        private BufferedReader in;
        private StringTokenizer st;

        void solve() throws IOException{

            int n = nextInt();
            HashSet<Integer>[]x = new HashSet[(n*(n-1))/2];
            for (int i = 0; i < x.length; i++) {
                x[i] = new HashSet<Integer>();
                int a = nextInt();
                for (int j = 0; j < a; j++) {
                    int y = nextInt();
                    x[i].add(y);
                }
            }

            for (int i = 0;i<x.length;++i) {
                ArrayList<Integer> l = new ArrayList<Integer>();
                for (Integer num : x[i]) {
                    l.add(num);
                }
                if(l.size() == 0) continue;
                int ref = l.get(0);
//              System.out.println(ref);
                ArrayList<Integer> set1 = new ArrayList<Integer>();
                ArrayList<Integer> set2 = new ArrayList<Integer>();
                set1.add(ref);
                for (int j = 1; j < l.size(); j++) {
                    boolean found = true;
                    for (int k = i+1; k < x.length; k++) {
                        if( (x[k].contains(ref) && !x[k].contains(l.get(j) )) || (!x[k].contains(ref) && x[k].contains(l.get(j))) ){
                            set2.add(l.get(j));
                            found = false;
                            break;
                        }
                    }
                    if(found) set1.add(l.get(j));
                    for (int k = i+1; k < x.length; k++) {
                        x[k].remove(l.get(j));
//                      x[k].remove(ref);
                    }
                }
                for (int k = i+1; k < x.length; k++) {
                    x[k].remove(ref);
                }

                System.out.print(set1.size());
                for (int j = 0; j < set1.size(); j++) {
                    System.out.print(" "+set1.get(j));
                }
                System.out.println();
                if(set2.size()>0){
                    System.out.print(set2.size());
                    for (int j = 0; j < set2.size(); j++) {
                        System.out.print(" "+set2.get(j));
                    }
                    System.out.println();
                }

            }
        }

        B() throws IOException {
            in = new BufferedReader(new InputStreamReader(System.in));
            eat("");
            solve();
        }

        private void eat(String str) {
            st = new StringTokenizer(str);
        }

        String next() throws IOException {
            while (!st.hasMoreTokens()) {
                String line = in.readLine();
                if (line == null) {
                    return null;
                }
                eat(line);
            }
            return st.nextToken();
        }

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

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

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

        public static void main(String[] args) throws IOException {
            new B();
        }

        int gcd(int a,int b){
            if(b>a) return gcd(b,a);
            if(b==0) return a;
            return gcd(b,a%b);
        }

}


import java.io.*;
import java.util.*;

public class B{

        private BufferedReader in;
        private StringTokenizer st;

        void solve() throws IOException{

            int n = nextInt();
            HashSet<Integer>[]x = new HashSet[(n*(n-1))/2];
            for (int i = 0; i < x.length; i++) {
                x[i] = new HashSet<Integer>();
                int a = nextInt();
                for (int j = 0; j < a; j++) {
                    int y = nextInt();
                    x[i].add(y);
                }
            }

            for (int i = 0;i<x.length;++i) {
                ArrayList<Integer> l = new ArrayList<Integer>();
                for (Integer num : x[i]) {
                    l.add(num);
                }
                if(l.size() == 0) continue;
                int ref = l.get(0);
//              System.out.println(ref);
                ArrayList<Integer> set1 = new ArrayList<Integer>();
                ArrayList<Integer> set2 = new ArrayList<Integer>();
                set1.add(ref);
                for (int j = 1; j < l.size(); j++) {
                    boolean found = true;
                    for (int k = i+1; k < x.length; k++) {
                        if( (x[k].contains(ref) && !x[k].contains(l.get(j) )) || (!x[k].contains(ref) && x[k].contains(l.get(j))) ){
                            set2.add(l.get(j));
                            found = false;
                            break;
                        }
                    }
                    if(found) set1.add(l.get(j));
                    for (int k = i+1; k < x.length; k++) {
                        x[k].remove(l.get(j));
                        x[k].remove(ref);
                    }
                }
                for (int k = i+1; k < x.length; k++) {
                    x[k].remove(ref);
                }

                System.out.print(set1.size());
                for (int j = 0; j < set1.size(); j++) {
                    System.out.print(" "+set1.get(j));
                }
                System.out.println();
                if(set2.size()>0){
                    System.out.print(set2.size());
                    for (int j = 0; j < set2.size(); j++) {
                        System.out.print(" "+set2.get(j));
                    }
                    System.out.println();
                }

            }
        }

        B() throws IOException {
            in = new BufferedReader(new InputStreamReader(System.in));
            eat("");
            solve();
        }

        private void eat(String str) {
            st = new StringTokenizer(str);
        }

        String next() throws IOException {
            while (!st.hasMoreTokens()) {
                String line = in.readLine();
                if (line == null) {
                    return null;
                }
                eat(line);
            }
            return st.nextToken();
        }

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

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

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

        public static void main(String[] args) throws IOException {
            new B();
        }

        int gcd(int a,int b){
            if(b>a) return gcd(b,a);
            if(b==0) return a;
            return gcd(b,a%b);
        }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;

public class B {

	/**
	 * @param args
	 * @throws IOException
	 * @throws NumberFormatException
	 */
	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(in.readLine());
		int nLines = (n * (n - 1)) / 2;
		List<int[]> list = new ArrayList<int[]>();
		String[] s;

		for (int i = 0; i < nLines; i++) {
			s = in.readLine().split(" ");
			int[] array = new int[Integer.parseInt(s[0])];
			for (int j = 1; j < s.length; j++) {
				array[j - 1] = (Integer.parseInt(s[j]));
			}
			Arrays.sort(array);
			list.add(array);
		}

		if (n == 2) {
			System.out.println(1 + " " + list.get(0)[0]);
			System.out.println(1 + " " + list.get(0)[1]);
			System.exit(0);
		}

		HashSet<Integer> c = new HashSet<Integer>();
		HashSet<HashSet<Integer>> ans = new HashSet<HashSet<Integer>>();
		out: for (int i = 0; i < list.size(); i++) {
			for (int j = i + 1; j < list.size(); j++) {
				int[] a = list.get(i);
				int[] b = list.get(j);

				boolean found = false;
				for (int k = 0, m = 0; m < b.length && k < a.length;) {
					if (a[k] == b[m]) {
						if (!found)
							c = new HashSet<Integer>();
						c.add(a[k]);
						k++;
						m++;
						found = true;
					} else {
						// if (found == true)
						// break;
						if (a[k] < b[m]) {
							k++;
						} else {
							m++;
						}
					}
				}

				if (found) {
					ans.add(c);
					HashSet<Integer> set = new HashSet<Integer>();
					for (int k = 0; k < a.length; k++) {
						if (!c.contains(a[k]))
							set.add(a[k]);
					}
					ans.add(set);

					set = new HashSet<Integer>();
					for (int k = 0; k < b.length; k++) {
						if (!c.contains(b[k]))
							set.add(b[k]);
					}
					ans.add(set);
					if (ans.size() == n)
						break out;
				}
			}
		}

		for (HashSet<Integer> hashSet : ans) {
			System.out.print(hashSet.size() + " ");
			for (Integer integer : hashSet) {
				System.out.print(integer + " ");
			}
			System.out.println();
		}
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;

public class B {

	/**
	 * @param args
	 * @throws IOException
	 * @throws NumberFormatException
	 */
	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(in.readLine());
		int nLines = (n * (n - 1)) / 2;
		List<int[]> list = new ArrayList<int[]>();
		String[] s;

		for (int i = 0; i < nLines; i++) {
			s = in.readLine().split(" ");
			int[] array = new int[Integer.parseInt(s[0])];
			for (int j = 1; j < s.length; j++) {
				array[j - 1] = (Integer.parseInt(s[j]));
			}
			Arrays.sort(array);
			list.add(array);
		}

		HashSet<Integer> c = new HashSet<Integer>();
		HashSet<HashSet<Integer>> ans = new HashSet<HashSet<Integer>>();
		out:
		for (int i = 0; i < list.size(); i++) {
			for (int j = i + 1; j < list.size(); j++) {
				int[] a = list.get(i);
				int[] b = list.get(j);

				boolean found = false;
				for (int k = 0, m = 0; m < b.length && k < a.length;) {
					if (a[k] == b[m]) {
						if (!found)
							c = new HashSet<Integer>();
						c.add(a[k]);
						k++;
						m++;
						found = true;
					} else {
//						if (found == true)
//							break;
						if (a[k] < b[m]) {
							k++;
						} else {
							m++;
						}
					}
				}

				if (found) {
					ans.add(c);
					HashSet<Integer> set = new HashSet<Integer>();
					for (int k = 0; k < a.length; k++) {
						if (!c.contains(a[k]))
							set.add(a[k]);
					}
					ans.add(set);

					set = new HashSet<Integer>();
					for (int k = 0; k < b.length; k++) {
						if (!c.contains(b[k]))
							set.add(b[k]);
					}
					ans.add(set);
					if(ans.size() == n) break out;
				}
			}
		}

		for (HashSet<Integer> hashSet : ans) {
			System.out.print(hashSet.size() + " ");
			for (Integer integer : hashSet) {
				System.out.print(integer + " ");
			}
			System.out.println();
		}
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;

public class B {

	/**
	 * @param args
	 * @throws IOException
	 * @throws NumberFormatException
	 */
	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(in.readLine());
		int nLines = (n * (n - 1)) / 2;
		List<int[]> list = new ArrayList<int[]>();
		String[] s;

		for (int i = 0; i < nLines; i++) {
			s = in.readLine().split(" ");
			int[] array = new int[Integer.parseInt(s[0])];
			for (int j = 1; j < s.length; j++) {
				array[j - 1] = (Integer.parseInt(s[j]));
			}
			Arrays.sort(array);
			list.add(array);
		}

		if (n == 2) {
			System.out.println(1 + " " + list.get(0)[0]);
			int a[] = list.get(0);
			System.out.print(a.length - 1 + " ");
			for (int i = 1; i < a.length; i++) {
				System.out.print(a[i] + (i < a.length - 1 ? " " : "\n"));
			}
			System.exit(0);
		}

		HashSet<Integer> c = new HashSet<Integer>();
		HashSet<HashSet<Integer>> ans = new HashSet<HashSet<Integer>>();
		out: for (int i = 0; i < list.size(); i++) {
			for (int j = i + 1; j < list.size(); j++) {
				int[] a = list.get(i);
				int[] b = list.get(j);

				boolean found = false;
				for (int k = 0, m = 0; m < b.length && k < a.length;) {
					if (a[k] == b[m]) {
						if (!found)
							c = new HashSet<Integer>();
						c.add(a[k]);
						k++;
						m++;
						found = true;
					} else {
						// if (found == true)
						// break;
						if (a[k] < b[m]) {
							k++;
						} else {
							m++;
						}
					}
				}

				if (found) {
					ans.add(c);
					HashSet<Integer> set = new HashSet<Integer>();
					for (int k = 0; k < a.length; k++) {
						if (!c.contains(a[k]))
							set.add(a[k]);
					}
					ans.add(set);

					set = new HashSet<Integer>();
					for (int k = 0; k < b.length; k++) {
						if (!c.contains(b[k]))
							set.add(b[k]);
					}
					ans.add(set);
					if (ans.size() == n)
						break out;
				}
			}
		}

		for (HashSet<Integer> hashSet : ans) {
			System.out.print(hashSet.size() + " ");
			for (Integer integer : hashSet) {
				System.out.print(integer + " ");
			}
			System.out.println();
		}
	}

}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Ura
 */
public class _82B {

    public static boolean isIntInArr(int[] arr, int a) {
        Arrays.sort(arr);
        int res = Arrays.binarySearch(arr, a);
        return res >= 0;
    }

    public static ArrayList<Integer> commonElems(int[] arr1, int[] arr2) {

        ArrayList<Integer> res = new ArrayList<Integer>();
        for (int i = 0; i < arr1.length; i++) {
            b:
            for (int j = 0; j < arr2.length; j++) {
                if (arr1[i] == arr2[j]) {
                    res.add(arr1[i]);
                    break b;
                }
            }
        }

        return res;
    }

    public static void main(String... args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();

        Set<Integer> s1 = new TreeSet<Integer>();

        int m = n * (n - 1) / 2;

        List<int[]> unions = new ArrayList<int[]>();

        List<ArrayList<Integer>> resSets = new ArrayList<ArrayList<Integer>>();

        int c = 0;

        for (int i = 0; i < m; i++) {
            c = s.nextInt();
            int[] a = new int[c];

            for (int j = 0; j < c; j++) {

                a[j] = s.nextInt();
                s1.add(a[j]);

            }
            unions.add(a);

        }

        while (s1.size() > 0) {
            Iterator<Integer> it = s1.iterator();
            //c: while (it.hasNext()) {
            // for (Iterator<Integer> it = s1.iterator(); it.hasNext();) {
            int tempInt = it.next();
            int[] a1 = null;
            int[] a2 = null;
            boolean isA1 = false;
            Iterator<int[]> itUnions = unions.iterator();
            b:
            while (itUnions.hasNext()) {
                int[] a = itUnions.next();

                if (!isA1) {
                    if (isIntInArr(a, tempInt)) {
                        a1 = a;
                        isA1 = true;
                        continue;
                    }
                }

                if (isA1) {
                    if (isIntInArr(a, tempInt)) {
                        a2 = a;
                        break b;
                    }
                }
            }

            ArrayList<Integer> arrTodd = commonElems(a1, a2);

            s1.removeAll(arrTodd);
            resSets.add(arrTodd);

            //  }
        }

//System.out.println(); System.out.println(); System.out.println();

        for (ArrayList<Integer> aa : resSets) {
            System.out.print(aa.size()+" ");

            for (int y:aa)  {
               System.out.print(y+" ");
            }
            System.out.println();

        }

    }
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Ura
 */
public class _82B {

    public static boolean isIntInArr(int[] arr, int a) {
        Arrays.sort(arr);
        int res = Arrays.binarySearch(arr, a);
        return res >= 0;
    }

    public static ArrayList<Integer> commonElems(int[] arr1, int[] arr2) {

        ArrayList<Integer> res = new ArrayList<Integer>();
        for (int i = 0; i < arr1.length; i++) {
            b:
            for (int j = 0; j < arr2.length; j++) {
                if (arr1[i] == arr2[j]) {
                    res.add(arr1[i]);
                    break b;
                }
            }
        }

        return res;
    }

    public static void main(String... args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();

        Set<Integer> s1 = new TreeSet<Integer>();

        if (n == 2) {
            int c = s.nextInt();
           // int[] cArr = new int[c];
            for (int i = 0; i < c-1; i++) {
                if (i==0) {
                    System.out.print(1+" "+ s.nextInt()+"\n"+(c-1));
                }
                System.out.print(" "+s.nextInt());

            }

        } else {

            int m = n * (n - 1) / 2;

            List<int[]> unions = new ArrayList<int[]>();

            List<ArrayList<Integer>> resSets = new ArrayList<ArrayList<Integer>>();

            int c = 0;

            for (int i = 0; i < m; i++) {
                c = s.nextInt();
                int[] a = new int[c];

                for (int j = 0; j < c; j++) {

                    a[j] = s.nextInt();
                    s1.add(a[j]);

                }
                unions.add(a);

            }

            while (s1.size() > 0) {
                Iterator<Integer> it = s1.iterator();
                //c: while (it.hasNext()) {
                // for (Iterator<Integer> it = s1.iterator(); it.hasNext();) {
                int tempInt = it.next();
                int[] a1 = null;
                int[] a2 = null;
                boolean isA1 = false;
                Iterator<int[]> itUnions = unions.iterator();
                b:
                while (itUnions.hasNext()) {
                    int[] a = itUnions.next();

                    if (!isA1) {
                        if (isIntInArr(a, tempInt)) {
                            a1 = a;
                            isA1 = true;
                            continue;
                        }
                    }

                    if (isA1) {
                        if (isIntInArr(a, tempInt)) {
                            a2 = a;
                            break b;
                        }
                    }
                }

                ArrayList<Integer> arrTodd = commonElems(a1, a2);

                s1.removeAll(arrTodd);
                resSets.add(arrTodd);

                //  }
            }

//System.out.println(); System.out.println(); System.out.println();

            for (ArrayList<Integer> aa : resSets) {
                System.out.print(aa.size() + " ");

                for (int y : aa) {
                    System.out.print(y + " ");
                }
                System.out.println();

            }

        }

    }
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Ura
 */
public class _82B {

    public static boolean isIntInArr(int[] arr, int a) {
        Arrays.sort(arr);
        int res = Arrays.binarySearch(arr, a);
        return res >= 0;
    }

    public static ArrayList<Integer> commonElems(int[] arr1, int[] arr2) {

        ArrayList<Integer> res = new ArrayList<Integer>();
        for (int i = 0; i < arr1.length; i++) {
            b:
            for (int j = 0; j < arr2.length; j++) {
                if (arr1[i] == arr2[j]) {
                    res.add(arr1[i]);
                    break b;
                }
            }
        }

        return res;
    }

    public static void main(String... args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();

        Set<Integer> s1 = new TreeSet<Integer>();

        if (n == 2) {
            int c = s.nextInt();
           // int[] cArr = new int[c];
            for (int i = 0; i < c; i++) {
                if (i==0) {
                    System.out.print(1+" "+ s.nextInt()+"\n"+(c-1));
                }
                System.out.print(" "+s.nextInt());

            }

        } else {

            int m = n * (n - 1) / 2;

            List<int[]> unions = new ArrayList<int[]>();

            List<ArrayList<Integer>> resSets = new ArrayList<ArrayList<Integer>>();

            int c = 0;

            for (int i = 0; i < m; i++) {
                c = s.nextInt();
                int[] a = new int[c];

                for (int j = 0; j < c; j++) {

                    a[j] = s.nextInt();
                    s1.add(a[j]);

                }
                unions.add(a);

            }

            while (s1.size() > 0) {
                Iterator<Integer> it = s1.iterator();
                //c: while (it.hasNext()) {
                // for (Iterator<Integer> it = s1.iterator(); it.hasNext();) {
                int tempInt = it.next();
                int[] a1 = null;
                int[] a2 = null;
                boolean isA1 = false;
                Iterator<int[]> itUnions = unions.iterator();
                b:
                while (itUnions.hasNext()) {
                    int[] a = itUnions.next();

                    if (!isA1) {
                        if (isIntInArr(a, tempInt)) {
                            a1 = a;
                            isA1 = true;
                            continue;
                        }
                    }

                    if (isA1) {
                        if (isIntInArr(a, tempInt)) {
                            a2 = a;
                            break b;
                        }
                    }
                }

                ArrayList<Integer> arrTodd = commonElems(a1, a2);

                s1.removeAll(arrTodd);
                resSets.add(arrTodd);

                //  }
            }

//System.out.println(); System.out.println(); System.out.println();

            for (ArrayList<Integer> aa : resSets) {
                System.out.print(aa.size() + " ");

                for (int y : aa) {
                    System.out.print(y + " ");
                }
                System.out.println();

            }

        }

    }
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Ura
 */
public class _82B {

    public static boolean isIntInArr(int[] arr, int a) {
        Arrays.sort(arr);
        int res = Arrays.binarySearch(arr, a);
        return res >= 0;
    }

    public static ArrayList<Integer> commonElems(int[] arr1, int[] arr2) {

        ArrayList<Integer> res = new ArrayList<Integer>();
        for (int i = 0; i < arr1.length; i++) {
            b:
            for (int j = 0; j < arr2.length; j++) {
                if (arr1[i] == arr2[j]) {
                    res.add(arr1[i]);
                    break b;
                }
            }
        }

        return res;
    }

    public static void main(String... args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();

        Set<Integer> s1 = new TreeSet<Integer>();

        if (n == 2) {
            int c = s.nextInt();
            // int[] cArr = new int[c];
            for (int i = 0; i < c; i++) {
                if (i == 0) {
                    System.out.print(1 + " " + s.nextInt() + "\n" + (c - 1));
                }
                System.out.print(" " + s.nextInt());

            }

        } else {

            int m = n * (n - 1) / 2;

            List<int[]> unions = new ArrayList<int[]>();

            List<ArrayList<Integer>> resSets = new ArrayList<ArrayList<Integer>>();

            int c = 0;
            int[] a = null;
            for (int i = 0; i < m; i++) {
                c = s.nextInt();

                a = new int[c];

                for (int j = 0; j < c; j++) {

                    a[j] = s.nextInt();
                    s1.add(a[j]);

                }
                unions.add(a);

            }

            while (s1.size() > 0) {
                Iterator<Integer> it = s1.iterator();
                //c: while (it.hasNext()) {
                // for (Iterator<Integer> it = s1.iterator(); it.hasNext();) {
                int tempInt = it.next();
                int[] a1 = null;
                int[] a2 = null;
                boolean isA1 = false;
                Iterator<int[]> itUnions = unions.iterator();
                b:
                while (itUnions.hasNext()) {
                    int[] a = itUnions.next();

                    if (!isA1) {
                        if (isIntInArr(a, tempInt)) {
                            a1 = a;
                            isA1 = true;
                            continue;
                        }
                    }

                    if (isA1) {
                        if (isIntInArr(a, tempInt)) {
                            a2 = a;
                            break b;
                        }
                    }
                }

                ArrayList<Integer> arrTodd = commonElems(a1, a2);

                s1.removeAll(arrTodd);
                resSets.add(arrTodd);

                //  }
            }

//System.out.println(); System.out.println(); System.out.println();

            for (ArrayList<Integer> aa : resSets) {
                System.out.print(aa.size() + " ");

                for (int y : aa) {
                    System.out.print(y + " ");
                }
                System.out.println();

            }

        }

    }
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Ura
 */
public class _82B {

    public static boolean isIntInArr(int[] arr, int a) {
        Arrays.sort(arr);
        int res = Arrays.binarySearch(arr, a);
        return res >= 0;
    }

    public static ArrayList<Integer> commonElems(int[] arr1, int[] arr2) {

        ArrayList<Integer> res = new ArrayList<Integer>();
        for (int i = 0; i < arr1.length; i++) {
            b:
            for (int j = 0; j < arr2.length; j++) {
                if (arr1[i] == arr2[j]) {
                    res.add(arr1[i]);
                    break b;
                }
            }
        }

        return res;
    }

    public static void main(String... args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();

        Set<Integer> s1 = new TreeSet<Integer>();

        if (n == 2) {
            int c = s.nextInt();
            // int[] cArr = new int[c];
            for (int i = 0; i < c; i++) {
                if (i == 0) {
                    System.out.print(1 + " " + s.nextInt() + "\n" + (c - 1));
                }
                System.out.print(" " + s.nextInt());

            }

        } else {

            int m = n * (n - 1) / 2;

            List<int[]> unions = new ArrayList<int[]>();

            List<ArrayList<Integer>> resSets = new ArrayList<ArrayList<Integer>>();

            int c = 0;
            int[] a = null;
            for (int i = 0; i < m; i++) {
                c = s.nextInt();

                a = new int[c];

                for (int j = 0; j < c; j++) {

                    a[j] = s.nextInt();
                    s1.add(a[j]);

                }
                unions.add(a);

            }

            while (s1.size() > 0) {
                Iterator<Integer> it = s1.iterator();
                //c: while (it.hasNext()) {
                // for (Iterator<Integer> it = s1.iterator(); it.hasNext();) {
                int tempInt = it.next();
                int[] a1 = null;
                int[] a2 = null;
                boolean isA1 = false;
                Iterator<int[]> itUnions = unions.iterator();
                b:
                while (itUnions.hasNext()) {
                    int[] aa = itUnions.next();

                    if (!isA1) {
                        if (isIntInArr(aa, tempInt)) {
                            a1 = aa;
                            isA1 = true;
                            continue;
                        }
                    }

                    if (isA1) {
                        if (isIntInArr(aa, tempInt)) {
                            a2 = aa;
                            break b;
                        }
                    }
                }

                ArrayList<Integer> arrTodd = commonElems(a1, a2);

                s1.removeAll(arrTodd);
                resSets.add(arrTodd);

                //  }
            }

//System.out.println(); System.out.println(); System.out.println();

            for (ArrayList<Integer> aa : resSets) {
                System.out.print(aa.size() + " ");

                for (int y : aa) {
                    System.out.print(y + " ");
                }
                System.out.println();

            }

        }

    }
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Ura
 */
public class _82B {

    public static boolean isIntInArr(int[] arr, int a) {
        Arrays.sort(arr);
        int res = Arrays.binarySearch(arr, a);
        return res >= 0;
    }

    public static ArrayList<Integer> commonElems(int[] arr1, int[] arr2) {

        ArrayList<Integer> res = new ArrayList<Integer>();
        for (int i = 0; i < arr1.length; i++) {
            b:
            for (int j = 0; j < arr2.length; j++) {
                if (arr1[i] == arr2[j]) {
                    res.add(arr1[i]);
                    break b;
                }
            }
        }

        return res;
    }

    public static void main(String... args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();

        Set<Integer> s1 = new TreeSet<Integer>();

        if (n == 2) {
            int c = s.nextInt();
            // int[] cArr = new int[c];
            for (int i = 0; i < c; i++) {
                if (i == 0) {
                    System.out.print(1 + " " + s.nextInt() + "\n" + (c - 1));
                }
                System.out.print(" " + s.nextInt());

            }

        } else {

            int m = n * (n - 1) / 2;

            List<int[]> unions = new ArrayList<int[]>();

            List<ArrayList<Integer>> resSets = new ArrayList<ArrayList<Integer>>();

            int c = 0;
            int[] a = null;
            for (int i = 0; i < m; i++) {
                c = s.nextInt();

                a = new int[c];

                for (int j = 0; j < c; j++) {

                    a[j] = s.nextInt();
                    s1.add(a[j]);

                }
                unions.add(a);

            }

            int[] a1 = null;
            int[] a2 = null;
            while (s1.size() > 0) {
                Iterator<Integer> it = s1.iterator();
                a1 = null;
                a2 = null;
                //c: while (it.hasNext()) {
                // for (Iterator<Integer> it = s1.iterator(); it.hasNext();) {
                int tempInt = it.next();

                boolean isA1 = false;
                Iterator<int[]> itUnions = unions.iterator();

                b:
                while (itUnions.hasNext()) {
                    int[] aa = itUnions.next();

                    if (!isA1) {
                        if (isIntInArr(a, tempInt)) {
                            a1 = aa;
                            isA1 = true;
                            continue;
                        }
                    }

                    if (isA1) {
                        if (isIntInArr(a, tempInt)) {
                            a2 = aa;
                            break b;
                        }
                    }
                }

                ArrayList<Integer> arrTodd = commonElems(a1, a2);

                s1.removeAll(arrTodd);
                resSets.add(arrTodd);

                //  }
            }

//System.out.println(); System.out.println(); System.out.println();

            for (ArrayList<Integer> aa : resSets) {
                System.out.print(aa.size() + " ");

                for (int y : aa) {
                    System.out.print(y + " ");
                }
                System.out.println();

            }

        }

    }
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Ura
 */
public class _82B {

    public static boolean isIntInArr(int[] arr, int a) {
        Arrays.sort(arr);
        int res = Arrays.binarySearch(arr, a);
        return res >= 0;
    }

    public static ArrayList<Integer> commonElems(int[] arr1, int[] arr2) {

        ArrayList<Integer> res = new ArrayList<Integer>();
        for (int i = 0; i < arr1.length; i++) {
            b:
            for (int j = 0; j < arr2.length; j++) {
                if (arr1[i] == arr2[j]) {
                    res.add(arr1[i]);
                    break b;
                }
            }
        }

        return res;
    }

    public static void main(String... args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();

        Set<Integer> s1 = new HashSet<Integer>();

        if (n == 2) {
            int c = s.nextInt();
            // int[] cArr = new int[c];
            for (int i = 0; i < c; i++) {
                if (i == 0) {
                    System.out.print(1 + " " + s.nextInt() + "\n" + (c - 1));
                }
                System.out.print(" " + s.nextInt());

            }

        } else {

            int m = n * (n - 1) / 2;

            List<int[]> unions = new ArrayList<int[]>();

            List<ArrayList<Integer>> resSets = new ArrayList<ArrayList<Integer>>();

            int c = 0;
            int[] a = null;
            for (int i = 0; i < m; i++) {
                c = s.nextInt();

                a = new int[c];

                for (int j = 0; j < c; j++) {

                    a[j] = s.nextInt();
                    s1.add(a[j]);

                }
                unions.add(a);

            }

            while (s1.size() > 0) {
                Iterator<Integer> it = s1.iterator();
                //c: while (it.hasNext()) {
                // for (Iterator<Integer> it = s1.iterator(); it.hasNext();) {
                int tempInt = it.next();
                int[] a1 = null;
                int[] a2 = null;
                boolean isA1 = false;
                Iterator<int[]> itUnions = unions.iterator();
                b:
                while (itUnions.hasNext()) {
                    int[] aa = itUnions.next();

                    if (!isA1) {
                        if (isIntInArr(aa, tempInt)) {
                            a1 = aa;
                            isA1 = true;
                            continue;
                        }
                    }

                    if (isA1) {
                        if (isIntInArr(aa, tempInt)) {
                            a2 = aa;
                            break b;
                        }
                    }
                }

                ArrayList<Integer> arrTodd = commonElems(a1, a2);

                s1.removeAll(arrTodd);
                resSets.add(arrTodd);

                //  }
            }

//System.out.println(); System.out.println(); System.out.println();

            for (ArrayList<Integer> aa : resSets) {
                System.out.print(aa.size() + " ");

                for (int y : aa) {
                    System.out.print(y + " ");
                }
                System.out.println();

            }

        }

    }
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Ura
 */
public class _82B {

    public static boolean isIntInArr(int[] arr, int a) {
        Arrays.sort(arr);
        int res = Arrays.binarySearch(arr, a);
        return res >= 0;
    }

    public static ArrayList<Integer> commonElems(int[] arr1, int[] arr2) {

        ArrayList<Integer> res = new ArrayList<Integer>();
        for (int i = 0; i < arr1.length; i++) {
            b:
            for (int j = 0; j < arr2.length; j++) {
                if (arr1[i] == arr2[j]) {
                    res.add(arr1[i]);
                    break b;
                }
            }
        }

        return res;
    }

    public static void main(String... args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();

        Set<Integer> s1 = new TreeSet<Integer>();

        if (n == 2) {
            int c = s.nextInt();
            // int[] cArr = new int[c];
            for (int i = 0; i < c; i++) {
                if (i == 0) {
                    System.out.print(1 + " " + s.nextInt() + "\n" + (c - 1));
                }
                System.out.print(" " + s.nextInt());

            }

        } else {

            int m = n * (n - 1) / 2;

            List<int[]> unions = new ArrayList<int[]>();

            List<ArrayList<Integer>> resSets = new ArrayList<ArrayList<Integer>>();

            int c = 0;
            int[] a = null;
            for (int i = 0; i < m; i++) {
                c = s.nextInt();

                a = new int[c];

                for (int j = 0; j < c; j++) {

                    a[j] = s.nextInt();
                    s1.add(a[j]);

                }
                unions.add(a);

            }

            int[] a1 = null;
            int[] a2 = null;
            while (s1.size() > 0) {
                Iterator<Integer> it = s1.iterator();
                //c: while (it.hasNext()) {
                // for (Iterator<Integer> it = s1.iterator(); it.hasNext();) {
                int tempInt = it.next();

                boolean isA1 = false;
                Iterator<int[]> itUnions = unions.iterator();
                int[] aa = null;
                b:
                while (itUnions.hasNext()) {
                    aa = itUnions.next();

                    if (!isA1) {
                        if (isIntInArr(a, tempInt)) {
                            a1 = aa;
                            isA1 = true;
                            continue;
                        }
                    }

                    if (isA1) {
                        if (isIntInArr(a, tempInt)) {
                            a2 = aa;
                            break b;
                        }
                    }
                }

                ArrayList<Integer> arrTodd = commonElems(a1, a2);

                s1.removeAll(arrTodd);
                resSets.add(arrTodd);

                //  }
            }

//System.out.println(); System.out.println(); System.out.println();

            for (ArrayList<Integer> aa : resSets) {
                System.out.print(aa.size() + " ");

                for (int y : aa) {
                    System.out.print(y + " ");
                }
                System.out.println();

            }

        }

    }
}


import java.util.HashSet;
import java.util.Iterator;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Ura
 */
public class _82B {

    public static void main(String... args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();

        Set<Integer> s1 = new TreeSet<Integer>();

        int m = n * (n - 1) / 2;

        int c = 0;
        for (int i = 0; i < m; i++) {
            c = s.nextInt();
            for (int j = 0; j < c; j++) {
                s1.add(s.nextInt());
            }
        }

        int count = 0;
        Iterator it = s1.iterator();
        int temp = 0;
        boolean isLast = true;
        b:
        while (it.hasNext()) {
            temp = (Integer) it.next();
            if (count > n - 2) {
                if (isLast) {
                    System.out.print((s1.size() - count) + " ");
                    isLast=false;
                }
                System.out.print(temp + " ");

                continue;

            }

            System.out.print("1 " + temp + "\n");
            // s1.remove(temp);
            count++;

        }

//        Iterator it2 = s1.iterator();
//        System.out.print(s1.size() + " ");
//        while (it.hasNext()) {
//            System.out.print(it2.next() + " ");
//
//        }

    }
}


import java.io.*;
import java.util.*;

public class NewSets {
	boolean[] used;
	int n;
	ArrayList<Integer> ans;
	int[][] a;
	void dfs(int i) {
		ans.add(i);
		used[i] = true;
		for (int j = 0; j < 300; j++)
			if (a[i][j] == n - 1 && !used[j])
				dfs(j);
	}

	void solve() throws Exception {
		n = nextInt();
		int nn = (n) * (n - 1) / 2;
		TreeSet<Integer> all = new TreeSet<Integer>();
		a = new int[300][300];
		for (int i = 0; i < nn; i++) {
			int cnt = nextInt();
			int[] r = new int[cnt];
			for (int j  = 0; j < cnt; j++) {
				r[j] = nextInt();
				all.add(r[j]);
			}
			for (int j = 0; j < cnt; j++)
				for (int k = j + 1; k < cnt; k++) {
					a[r[j]][r[k]] ++;
					a[r[k]][r[j]] ++;
				}
		}
		used = new boolean[300];
		for (int i: all) {
			if (used[i])
				continue;
			ans = new ArrayList<Integer>();
			dfs(i);
			out.print(ans.size() + " ");
			for (int j: ans)
				out.print(j + " ");
			out.println();
		}

	}

	void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);

			solve();

			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	BufferedReader in;
	StringTokenizer st;
	PrintWriter out;
	final String filename = new String("Sets").toLowerCase();

	String nextToken() throws Exception {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}

	int nextInt() throws Exception {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws Exception {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws Exception {
		return Double.parseDouble(nextToken());
	}

	public static void main(String[] args) {
		new NewSets().run();
	}

}


import java.io.*;
import java.util.*;

public class NewSets {
    boolean[] used;
    int n;
    ArrayList<Integer> ans;
    int[][] a;

    void dfs(int i) {
        ans.add(i);
        used[i] = true;
        for (int j = 1; j < 201; j++)
            if (a[i][j] == n - 1 && !used[j])
                dfs(j);
    }

    void solve() throws Exception {
        n = nextInt();
        int nn = (n) * (n - 1) / 2;
        TreeSet<Integer> all = new TreeSet<Integer>();
        a = new int[201][201];
        if (n == 2) {
            int t = nextInt();
            out.println("1 " + nextInt());
            out.print((t - 1) + " ");
            for (int i = 0; i < t - 1; i++)
                out.print(nextInt() + " ");
            out.println();
            return;
        }
        for (int i = 0; i < nn; i++) {
            int cnt = nextInt();
            int[] r = new int[cnt];
            for (int j = 0; j < cnt; j++) {
                r[j] = nextInt();
                all.add(r[j]);
            }
            for (int j = 0; j < cnt; j++)
                for (int k = j + 1; k < cnt; k++) {
                    a[r[j]][r[k]]++;
                    a[r[k]][r[j]]++;
                }
        }
        used = new boolean[201];
        for (int i : all) {
            if (used[i])
                continue;
            ans = new ArrayList<Integer>();
            dfs(i);
            out.print(ans.size() + " ");
            for (int j : ans)
                out.print(j + " ");
            out.println();
        }

    }

    void run() {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);

            solve();

            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    BufferedReader in;
    StringTokenizer st;
    PrintWriter out;
    final String filename = new String("Sets").toLowerCase();

    String nextToken() throws Exception {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(in.readLine());
        return st.nextToken();
    }

    int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }

    public static void main(String[] args) {
        new NewSets().run();
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class B {
  public static void main(String[] args) throws IOException {
    new B().solve();
  }

  BufferedReader br;
  StringTokenizer st = new StringTokenizer("");

  private void solve() throws IOException {
    br = new BufferedReader(new InputStreamReader(System.in));
    int n = nextInt();
    int pairCount = (n * (n - 1)) / 2;
    int[][] a = new int[pairCount][];
    for (int i = 0; i < pairCount; i++) {
      int m = nextInt();
      a[i] = new int[m];
      for (int j = 0; j < m; j++) {
        a[i][j] = nextInt();
      }
    }
    br.close();
    final Collection<List<Integer>> ansList;
    if (n == 2) {
      ansList = solve2(a[0]);
    } else {
      Map<Integer, SetBuilder> num2sb = new HashMap<Integer, SetBuilder>();
      for (int i = 0; i < a.length; i++) {
        for (int x : a[i]) {
          SetBuilder sb = num2sb.get(x);
          if (sb == null) {
            sb = new SetBuilder();
            num2sb.put(x, sb);
          }
          sb.rows.add(i);
        }
      }
      Map<SetKey, List<Integer>> ans = new HashMap<SetKey, List<Integer>>();
      for (Map.Entry<Integer, SetBuilder> entry : num2sb.entrySet()) {
        SetKey setKey = new SetKey(entry.getValue().rows);
        List<Integer> list = ans.get(setKey);
        if (list == null) {
          list = new ArrayList<Integer>();
          ans.put(setKey, list);
        }
        list.add(entry.getKey());
      }
      ansList = ans.values();
    }

    PrintWriter pw = new PrintWriter(System.out);
    for (List<Integer> list : ansList) {
      Collections.sort(list);
      pw.print(list.size());
      for (Integer x : list) {
        pw.print(" ");
        pw.print(x);
      }
      pw.println();
    }
    pw.close();
  }

  private Collection<List<Integer>> solve2(int[] a) {
    List<Integer> list = new ArrayList<Integer>();
    for (int i : a) {
      list.add(i);
    }
    return Arrays.asList(
        Arrays.asList(list.get(0)),
        list.subList(1, list.size())
    );
  }

  static class SetBuilder {
    List<Integer> rows = new ArrayList<Integer>();
  }

  static class SetKey {
    final int hash;
    final Set<Integer> rows;

    SetKey(Collection<Integer> rows) {
      this.rows = new HashSet<Integer>(rows);
      this.hash = rows.hashCode();
    }

    @Override
    public boolean equals(Object o) {
      if (this == o) return true;
      if (o == null || getClass() != o.getClass()) return false;

      SetKey key = (SetKey) o;

      return hash == key.hash && rows.equals(key.rows);
    }

    @Override
    public int hashCode() {
      return hash;
    }
  }

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

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class B {
  public static void main(String[] args) throws IOException {
    new B().solve();
  }

  BufferedReader br;
  StringTokenizer st = new StringTokenizer("");

  private void solve() throws IOException {
    br = new BufferedReader(new InputStreamReader(System.in));
    int n = nextInt();
    int pairCount = (n * (n - 1)) / 2;
    int[][] a = new int[pairCount][];
    for (int i = 0; i < (n * (n - 1)) / 2; i++) {
      int m = nextInt();
      a[i] = new int[m];
      for (int j = 0; j < m; j++) {
        a[i][j] = nextInt();
      }
    }
    br.close();
    Map<Integer, SetBuilder> num2sb = new HashMap<Integer, SetBuilder>();
    for (int i = 0; i < a.length; i++) {
      for (int x : a[i]) {
        SetBuilder sb = num2sb.get(x);
        if (sb == null) {
          sb = new SetBuilder();
          num2sb.put(x, sb);
        }
        sb.rows.add(i);
      }
    }
    Map<SetKey, List<Integer>> ans = new HashMap<SetKey, List<Integer>>();
    for (Map.Entry<Integer, SetBuilder> entry : num2sb.entrySet()) {
      SetKey setKey = new SetKey(entry.getValue().rows);
      List<Integer> list = ans.get(setKey);
      if (list == null) {
        list = new ArrayList<Integer>();
        ans.put(setKey, list);
      }
      list.add(entry.getKey());
    }

    PrintWriter pw = new PrintWriter(System.out);
    for (List<Integer> list : ans.values()) {
      pw.print(list.size());
      for (Integer x : list) {
        pw.print(" ");
        pw.print(x);
      }
      pw.println();
    }
    pw.close();
  }

  static class SetBuilder {
    List<Integer> rows = new ArrayList<Integer>();
  }

  static class SetKey {
    final int hash;
    final List<Integer> rows;

    SetKey(List<Integer> rows) {
      this.rows = rows;
      this.hash = rows.hashCode();
    }

    @Override
    public boolean equals(Object o) {
      if (this == o) return true;
      if (o == null || getClass() != o.getClass()) return false;

      SetKey key = (SetKey) o;

      return hash == key.hash && rows.equals(key.rows);
    }

    @Override
    public int hashCode() {
      return hash;
    }
  }

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

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


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class B {

    public static String aaa = "4\n" +
            "3 2 7 4\n" +
            "3 1 7 3\n" +
            "3 5 4 2\n" +
            "3 1 3 5\n" +
            "4 3 1 2 4\n" +
            "2 5 7";

    public static void main(final String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        Scanner sc = new Scanner(reader);
        int n = sc.nextInt();

        int N = (n - 1) * n / 2;

        List<Set<Integer>> lst = new ArrayList<Set<Integer>>(N);

        for (int i = 0; i < N; i++) {
            int num = sc.nextInt();
            Set<Integer> set = new HashSet<Integer>(num);
            for (int k = 0; k < num; k++) {
                set.add(sc.nextInt());
            }
            lst.add(set);
        }

        if (N == 1) {
            Set<Integer> first = lst.get(0);
            Set<Integer> second = new HashSet<Integer>();
            second.add(first.iterator().next());

            first.removeAll(second);
            print(first);
            print(second);

            return;
        }

        Set<Integer> first = lst.get(0);
        Set<Integer> sec = null;
        for (int i = 1; i < N; i++) {
            Set<Integer> second = lst.get(i);
            for (Integer in : second) {
                if (first.contains(in)) {
                    sec = second;
                    break;
                }
            }
        }

        first = new HashSet<Integer>(first); first.removeAll(sec);

        print(first);
        for (int i = 0; i < N; i++) {
            Set<Integer> second = lst.get(i);
            boolean res = second.removeAll(first);
            if (!second.isEmpty() && res) {
                print(second);
            }
        }

    }

    public static void print(Set<Integer> set) {
        System.out.print(set.size() + " ");
        for (int el : set) {
            System.out.print(el + " ");
        }
        System.out.println();
    }

}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class B {

    public static String aaa = "4\n" +
            "3 2 7 4\n" +
            "3 1 7 3\n" +
            "3 5 4 2\n" +
            "3 1 3 5\n" +
            "4 3 1 2 4\n" +
            "2 5 7";

    public static void main(final String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        Scanner sc = new Scanner(reader);
        int n = sc.nextInt();

        int N = (n - 1) * n / 2;

        List<Set<Integer>> lst = new ArrayList<Set<Integer>>(N);

        for (int i = 0; i < N; i++) {
            int num = sc.nextInt();
            Set<Integer> set = new HashSet<Integer>(num);
            for (int k = 0; k < num; k++) {
                set.add(sc.nextInt());
            }
            lst.add(set);
        }

        Set<Integer> first = lst.get(0);
        Set<Integer> sec = null;
        for (int i = 1; i < N; i++) {
            Set<Integer> second = lst.get(i);
            for (Integer in : second) {
                if (first.contains(in)) {
                    sec = second;
                    break;
                }
            }
        }

        first = new HashSet<Integer>(first); first.removeAll(sec);

        print(first);
        for (int i = 0; i < N; i++) {
            Set<Integer> second = lst.get(i);
            boolean res = second.removeAll(first);
            if (!second.isEmpty() && res) {
                print(second);
            }
        }

    }

    public static void print(Set<Integer> set) {
        System.out.print(set.size() + " ");
        for (int el : set) {
            System.out.print(el + " ");
        }
        System.out.println();
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;

public class B {
    public static void main(String[] args) throws NumberFormatException,
            IOException {

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());

        boolean[][] E = new boolean[201][201];
        boolean[] C = new boolean[201];
        for (int i = 1; i <= 200; i++)
            Arrays.fill(E[i], true);
        if (n == 2) {
            String[] S = in.readLine().split(" ");
            System.out.println("1 " + S[1]);
            System.out.print("1 ");
            for (int i = 2; i < S.length; i++)
                if (i == 2)
                    System.out.print(S[i]);
                else
                    System.out.print(" " + S[i]);
            System.out.println();
        } else {
            for (int i = 0; i < (n * (n - 1)) / 2; i++) {
                String[] S = in.readLine().split(" ");
                HashSet<Integer> H = new HashSet<Integer>();
                for (int j = 1; j < S.length; j++) {
                    H.add(Integer.parseInt(S[j]));
                    C[Integer.parseInt(S[j])] = true;
                }
                for (int j = 1; j < S.length; j++) {
                    for (int k = 1; k <= 200; k++)
                        if (!H.contains(k))
                            E[Integer.parseInt(S[j])][k] = false;
                }
            }
            for (int i = 1; i <= 200; i++) {
                if (!C[i])
                    continue;
                int c = 0;
                for (int j = 1; j <= 200; j++)
                    if (E[i][j])
                        c++;
                System.out.print(c);
                for (int j = 1; j <= 200; j++) {
                    if (E[i][j]) {
                        C[j] = false;
                        System.out.print(" " + j);
                    }
                }
                System.out.println();
            }
        }

    }
};


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;

public class B {
    public static void main(String[] args) throws NumberFormatException,
            IOException {

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());

        boolean[][] E = new boolean[201][201];
        boolean[] C = new boolean[201];
        for (int i = 1; i <= 200; i++)
            Arrays.fill(E[i], true);
        for (int i = 0; i < (n * (n - 1)) / 2; i++) {
            String[] S = in.readLine().split(" ");
            HashSet<Integer> H = new HashSet<Integer>();
            for (int j = 1; j < S.length; j++) {
                H.add(Integer.parseInt(S[j]));
                C[Integer.parseInt(S[j])] = true;
            }
            for (int j = 1; j < S.length; j++) {
                for (int k = 1; k <= 200; k++)
                    if (!H.contains(k))
                        E[Integer.parseInt(S[j])][k] = false;
            }
        }
        for (int i = 1; i <= 200; i++) {
            if (!C[i])
                continue;
            int c = 0;
            for (int j = 1; j <= 200; j++)
                if (E[i][j])
                    c++;
            System.out.print(c);
            for (int j = 1; j <= 200; j++) {
                if (E[i][j]) {
                    C[j] = false;
                    System.out.print(" " + j);
                }
            }
            System.out.println();
        }
        if (n == 2)
            System.out.println(0);
    }
};


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;

public class B {
    public static void main(String[] args) throws NumberFormatException,
            IOException {

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());

        boolean[][] E = new boolean[201][201];
        boolean[] C = new boolean[201];
        for (int i = 1; i <= 200; i++)
            Arrays.fill(E[i], true);
        if (n == 2) {
            String[] S = in.readLine().split(" ");
            System.out.println("1 " + S[1]);
            System.out.print((S.length - 2) + " ");
            for (int i = 2; i < S.length; i++)
                if (i == 2)
                    System.out.print(S[i]);
                else
                    System.out.print(" " + S[i]);
            System.out.println();
        } else {
            for (int i = 0; i < (n * (n - 1)) / 2; i++) {
                String[] S = in.readLine().split(" ");
                HashSet<Integer> H = new HashSet<Integer>();
                for (int j = 1; j < S.length; j++) {
                    H.add(Integer.parseInt(S[j]));
                    C[Integer.parseInt(S[j])] = true;
                }
                for (int j = 1; j < S.length; j++) {
                    for (int k = 1; k <= 200; k++)
                        if (!H.contains(k))
                            E[Integer.parseInt(S[j])][k] = false;
                }
            }
            for (int i = 1; i <= 200; i++) {
                if (!C[i])
                    continue;
                int c = 0;
                for (int j = 1; j <= 200; j++)
                    if (E[i][j])
                        c++;
                System.out.print(c);
                for (int j = 1; j <= 200; j++) {
                    if (E[i][j]) {
                        C[j] = false;
                        System.out.print(" " + j);
                    }
                }
                System.out.println();
            }
        }

    }
};


import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author pttrung
 */
public class B {

    public static void main(String[] args) {
        Scanner in = new Scanner(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        int[] total = new int[201];
        HashMap<Integer, HashSet<Integer>> map = new HashMap();
        for (int i = 0; i < (n * (n - 1)) / 2; i++) {
            int k = in.nextInt();
            HashSet<Integer> temp = new HashSet();
            for (int j = 0; j < k; j++) {
                int val = in.nextInt();
                total[val]++;
                temp.add(val);
            }
            for (int val : temp) {
                if (!map.containsKey(val)) {
                    map.put(val, temp);
                } else {
                    HashSet<Integer> set = map.get(val);
                    HashSet<Integer> result = new HashSet();
                    for (int other : set) {
                        if (temp.contains(other)) {
                            result.add(other);
                        }
                    }
                    map.put(val, result);
                }
            }
        }
        if (n != 2) {
            HashSet<Integer> result = new HashSet();
            for (int val : map.keySet()) {
                if (result.contains(val)) {
                    continue;
                } else {
                    StringBuilder builder = new StringBuilder();
                    int count = 0;
                    for (int other : map.get(val)) {
                        for (int i = 0; i < total[other]; i++) {
                            count++;
                            builder.append(other).append(" ");
                        }
                        result.add(other);
                    }
                    builder.insert(0, count + " ");
                    out.println(builder.toString());
                }
            }
        } else {
            int count = 0;
            int sum = 0;
            StringBuilder b = new StringBuilder();
            for (int i = 0; i < total.length; i++) {
                if (total[i] > 0) {
                    if (count == 0) {
                        count++;
                        out.print(total[i] + " ");
                        for (int j = 0; j < total[i]; j++) {
                            out.println(i + " ");
                        }
                    } else {
                        sum += total[i];
                        for (int j = 0; j < total[i]; j++) {
                            b.append(i + " ");
                        }
                    }
                }
            }
            b.insert(0, sum);
            out.println(b.toString());

        }
        out.close();
    }

    public double pow(double a, int b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        double val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val;
        } else {
            return val * val * a;
        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }
}


import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author pttrung
 */
public class B {

    public static void main(String[] args) {
        Scanner in = new Scanner(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        HashMap<Integer, HashSet<Integer>> map = new HashMap();
        for (int i = 0; i < n * (n - 1) / 2; i++) {
            int k = in.nextInt();
            HashSet<Integer> temp = new HashSet();
            for (int j = 0; j < k; j++) {
                temp.add(in.nextInt());
            }
            for (int val : temp) {
                if (!map.containsKey(val)) {
                    map.put(val, temp);
                } else {
                    HashSet<Integer> set = map.get(val);
                    HashSet<Integer> result = new HashSet();
                    for (int other : set) {
                        if (temp.contains(other)) {
                            result.add(other);
                        }
                    }
                    map.put(val, result);
                }
            }
        }
        HashSet<Integer> result = new HashSet();
        for (int val : map.keySet()) {
            if (result.contains(val)) {
                continue;
            } else {
                out.print(map.get(val).size() + " ");
                for (int other : map.get(val)) {
                    out.print(other + " ");
                    result.add(other);
                }
                out.println();
            }
        }
        out.close();
    }

    public double pow(double a, int b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        double val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val;
        } else {
            return val * val * a;
        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }
}


import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author pttrung
 */
public class B {

    public static void main(String[] args) {
        Scanner in = new Scanner(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        HashMap<Integer, HashSet<Integer>> map = new HashMap();
        for (int i = 0; i < (n * (n - 1)) / 2; i++) {
            int k = in.nextInt();
            HashSet<Integer> temp = new HashSet();
            for (int j = 0; j < k; j++) {
                temp.add(in.nextInt());
            }
            for (int val : temp) {
                if (!map.containsKey(val)) {
                    map.put(val, temp);
                } else {
                    HashSet<Integer> set = map.get(val);
                    HashSet<Integer> result = new HashSet();
                    for (int other : set) {
                        if (temp.contains(other)) {
                            result.add(other);
                        }
                    }
                    map.put(val, result);
                }
            }
        }
        HashSet<Integer> result = new HashSet();
        for (int val : map.keySet()) {
            if (result.contains(val)) {
                continue;
            } else {
                out.print(map.get(val).size() + " ");
                for (int other : map.get(val)) {
                    out.print(other + " ");
                    result.add(other);
                }
                out.println();
            }
        }
        out.close();
    }

    public double pow(double a, int b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        double val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val;
        } else {
            return val * val * a;
        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }
}


import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author pttrung
 */
public class B {

    public static void main(String[] args) {
        Scanner in = new Scanner(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        int[] total = new int[201];
        HashMap<Integer, HashSet<Integer>> map = new HashMap();
        for (int i = 0; i < (n * (n - 1)) / 2; i++) {
            int k = in.nextInt();
            HashSet<Integer> temp = new HashSet();
            int [] check = new int[201];
            for (int j = 0; j < k; j++) {
                int val = in.nextInt();
                check[val]++;
                temp.add(val);
            }
            for(int j = 0; j < total.length; j++){
                total[j] = Math.max(check[j] , total[j]);
            }
            for (int val : temp) {
                if (!map.containsKey(val)) {
                    map.put(val, temp);
                } else {
                    HashSet<Integer> set = map.get(val);
                    HashSet<Integer> result = new HashSet();
                    for (int other : set) {
                        if (temp.contains(other)) {
                            result.add(other);
                        }
                    }
                    map.put(val, result);
                }
            }
        }
        if (n != 2) {
            HashSet<Integer> result = new HashSet();
            for (int val : map.keySet()) {
                if (result.contains(val)) {
                    continue;
                } else {
                    StringBuilder builder = new StringBuilder();
                    int count = 0;
                    for (int other : map.get(val)) {
                        for (int i = 0; i < total[other]; i++) {
                            count++;
                            builder.append(other).append(" ");
                        }
                        result.add(other);
                    }
                    builder.insert(0, count + " ");
                    out.println(builder.toString());
                }
            }
        } else {
            int count = 0;
            int sum = 0;
            StringBuilder b = new StringBuilder();
            for (int i = 0; i < total.length; i++) {
                if (total[i] > 0) {
                    if (count == 0) {
                        count++;
                        out.print(total[i] + " ");
                        for (int j = 0; j < total[i]; j++) {
                            out.println(i + " ");
                        }
                    } else {
                        sum += total[i];
                        for (int j = 0; j < total[i]; j++) {
                            b.append(i).append(" ");
                        }
                    }
                }
            }
            b.insert(0, sum + " ");
            out.println(b.toString());

        }
        out.close();
    }

    public double pow(double a, int b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        double val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val;
        } else {
            return val * val * a;
        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }
}


import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author pttrung
 */
public class B {

    public static void main(String[] args) {
        Scanner in = new Scanner(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        int[] total = new int[201];
        HashMap<Integer, HashSet<Integer>> map = new HashMap();
        for (int i = 0; i < (n * (n - 1)) / 2; i++) {
            int k = in.nextInt();
            HashSet<Integer> temp = new HashSet();
            int [] check = new int[201];
            for (int j = 0; j < k; j++) {
                int val = in.nextInt();
                check[val]++;
                temp.add(val);
            }
            for(int j = 0; j < total.length; j++){
                total[j] = Math.max(check[j] , total[j]);
            }
            for (int val : temp) {
                if (!map.containsKey(val)) {
                    map.put(val, temp);
                } else {
                    HashSet<Integer> set = map.get(val);
                    HashSet<Integer> result = new HashSet();
                    for (int other : set) {
                        if (temp.contains(other)) {
                            result.add(other);
                        }
                    }
                    map.put(val, result);
                }
            }
        }
        if (n != 2) {
            HashSet<Integer> result = new HashSet();
            for (int val : map.keySet()) {
                if (result.contains(val)) {
                    continue;
                } else {
                    StringBuilder builder = new StringBuilder();
                    int count = 0;
                    for (int other : map.get(val)) {
                        for (int i = 0; i < total[other]; i++) {
                            count++;
                            builder.append(other).append(" ");
                        }
                        result.add(other);
                    }
                    builder.insert(0, count + " ");
                    out.println(builder.toString());
                }
            }
        } else {
            int count = 0;
            int sum = 0;
            StringBuilder b = new StringBuilder();
            for (int i = 0; i < total.length; i++) {
                if (total[i] > 0) {
                    if (count == 0) {
                        count++;
                        out.print(total[i] + " ");
                        for (int j = 0; j < total[i]; j++) {
                            out.println(i + " ");
                        }
                    } else {
                        sum += total[i];
                        for (int j = 0; j < total[i]; j++) {
                            b.append(i + " ");
                        }
                    }
                }
            }
            b.insert(0, sum);
            out.println(b.toString());

        }
        out.close();
    }

    public double pow(double a, int b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        double val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val;
        } else {
            return val * val * a;
        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }
}


import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author pttrung
 */
public class B {

    public static void main(String[] args) {
        Scanner in = new Scanner(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        HashMap<Integer, HashSet<Integer>> map = new HashMap();
        for (int i = 0; i < (n * (n - 1)) / 2; i++) {
            int k = in.nextInt();
            HashSet<Integer> temp = new HashSet();
            for (int j = 0; j < k; j++) {
                temp.add(in.nextInt());
            }
            for (int val : temp) {
                if (!map.containsKey(val)) {
                    map.put(val, temp);
                } else {
                    HashSet<Integer> set = map.get(val);
                    HashSet<Integer> result = new HashSet();
                    for (int other : set) {
                        if (temp.contains(other)) {
                            result.add(other);
                        }
                    }
                    map.put(val, result);
                }
            }
        }
        if (n != 2) {
            HashSet<Integer> result = new HashSet();
            for (int val : map.keySet()) {
                if (result.contains(val)) {
                    continue;
                } else {
                    out.print(map.get(val).size() + " ");
                    for (int other : map.get(val)) {
                        out.print(other + " ");
                        result.add(other);
                    }
                    out.println();
                }
            }
        } else {
            int count = 0;
            int total = map.keySet().size();
            for (int val : map.keySet()) {
                if (count == 0) {

                    out.println(1 + " " +val);
                    count++;
                }else{
                    out.print(total - 1 + " ");
                    out.print(val + " ");
                }
            }
        }
        out.close();
    }

    public double pow(double a, int b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        double val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val;
        } else {
            return val * val * a;
        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }
}


import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author pttrung
 */
public class B {

    public static void main(String[] args) {
        Scanner in = new Scanner(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        int[] total = new int[201];
        HashMap<Integer, HashSet<Integer>> map = new HashMap();
        for (int i = 0; i < (n * (n - 1)) / 2; i++) {
            int k = in.nextInt();
            HashSet<Integer> temp = new HashSet();
            int [] check = new int[201];
            for (int j = 0; j < k; j++) {
                int val = in.nextInt();
                check[val]++;
                temp.add(val);
            }
            for(int j = 0; j < total.length; j++){
                total[j] = Math.max(check[j] , total[j]);
            }
            for (int val : temp) {
                if (!map.containsKey(val)) {
                    map.put(val, temp);
                } else {
                    HashSet<Integer> set = map.get(val);
                    HashSet<Integer> result = new HashSet();
                    for (int other : set) {
                        if (temp.contains(other)) {
                            result.add(other);
                        }
                    }
                    map.put(val, result);
                }
            }
        }
        if (n != 2) {
            HashSet<Integer> result = new HashSet();
            for (int val : map.keySet()) {
                if (result.contains(val)) {
                    continue;
                } else {
                    StringBuilder builder = new StringBuilder();
                    int count = 0;
                    for (int other : map.get(val)) {
                        for (int i = 0; i < total[other]; i++) {
                            count++;
                            builder.append(other).append(" ");
                        }
                        result.add(other);
                    }
                    builder.insert(0, count + " ");
                    out.println(builder.toString());
                }
            }
        } else {
            int count = 0;
            int sum = 0;
            StringBuilder b = new StringBuilder();
            for (int i = 0; i < total.length; i++) {
                if (total[i] > 0) {
                    if (count == 0) {
                        count++;
                        out.print(total[i] + " ");
                        for (int j = 0; j < total[i]; j++) {
                            out.println(i + " ");
                        }
                    } else {
                        sum += total[i];
                        for (int j = 0; j < total[i]; j++) {
                            b.append(i + " ");
                        }
                    }
                }
            }
            b.insert(0, sum + " ");
            out.println(b.toString());

        }
        out.close();
    }

    public double pow(double a, int b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        double val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val;
        } else {
            return val * val * a;
        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }
}


import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author pttrung
 */
public class B {

    public static void main(String[] args) {
        Scanner in = new Scanner(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        HashMap<Integer, HashSet<Integer>> map = new HashMap();
        for (int i = 0; i < (n * (n - 1)) / 2; i++) {
            int k = in.nextInt();
            HashSet<Integer> temp = new HashSet();
            for (int j = 0; j < k; j++) {
                temp.add(in.nextInt());
            }
            for (int val : temp) {
                if (!map.containsKey(val)) {
                    map.put(val, temp);
                } else {
                    HashSet<Integer> set = map.get(val);
                    HashSet<Integer> result = new HashSet();
                    for (int other : set) {
                        if (temp.contains(other)) {
                            result.add(other);
                        }
                    }
                    map.put(val, result);
                }
            }
        }
        if (n > 2) {
            HashSet<Integer> result = new HashSet();
            for (int val : map.keySet()) {
                if (result.contains(val)) {
                    continue;
                } else {
                    out.print(map.get(val).size() + " ");
                    for (int other : map.get(val)) {
                        out.print(other + " ");
                        result.add(other);
                    }
                    out.println();
                }
            }
        } else {
            int count = 0;
            for (int val : map.keySet()) {
                if (count == 0) {
                    out.println(val);
                    count++;
                }else{
                    out.print(val + " ");
                }
            }
        }
        out.close();
    }

    public double pow(double a, int b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        double val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val;
        } else {
            return val * val * a;
        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }
}