import static java.lang.Math.*;

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

public class B {

    public void solve() throws Exception {
        int n = nextInt();
        int m = (n-1)*n/2;

        if (n==2) {
            int k = nextInt();
            print(1,nextInt());
            println();
            print(k-1);
            for (int i=1; i<k; i++)
                print(" "+nextInt());
            println();
            return;
        }

        int[][] poc = new int[210][210];
        TreeSet<Integer> mame = new TreeSet<Integer>();

        for (int i=0; i<m; i++) {
            int k = nextInt();
            TreeSet<Integer> ts = new TreeSet<Integer>();
            for (int j=0; j<k; j++) {
                int cislo = nextInt();
                ts.add(cislo);
                mame.add(cislo);
            }
//          debug(ts.toString());
            for (Integer a: ts) {
                for (Integer b: ts) {
                    if (a!=b) {
                        poc[a][b]++;
                        poc[b][a]++;
                    }
                }
            }
        }

//      for (int[] p: poc)
//          debug(p);

        TreeSet<Integer> bol = new TreeSet<Integer>();
        TreeSet<Integer>[] r = new TreeSet[n];
        for (int i=0; i<n; i++) r[i] = new TreeSet<Integer>();

        int pos = 0;
        for (int i=1; i<=200; i++) {
            boolean b = false;
            for (int j=i; j<=200; j++) {
                if (poc[i][j]==(n-1)*2 && !bol.contains(j)) {
                    r[pos].add(i); r[pos].add(j);
                    bol.add(i); bol.add(j);
                    b=true;
                }
            }
            if (b) pos++;
        }

//      for (TreeSet t: r)
//          debug(t);
//      debug(mame);
//      debug(bol);

        for (Integer vsetky: mame) {
            if (!bol.contains(vsetky)) {
                bol.add(vsetky);
                r[pos++].add(vsetky);
            }
        }

//      for (TreeSet t: r)
//          debug(t);

        for (TreeSet<Integer> set: r) {
            print(set.size());
            for (Integer cislo: set)
                print("",cislo);
            println();
        }

    }

    ////////////////////////////////////////////////////////////////////////////

    double EPS = 1e-7;
    int INF = Integer.MAX_VALUE;
    long INFL = Long.MAX_VALUE;
    double INFD = Double.MAX_VALUE;

    int[] dx = {0,1,0,-1};
    int[] dy = {-1,0,1,0};
    int[] dx8 = {0,1,1,1,0,-1,-1,-1};
    int[] dy8 = {-1,-1,0,1,1,1,0,-1};
    int[] knightMovesX = {1,2,2,1,-1,-2,-2,-1};
    int[] knightMovesY = {-2,-1,1,2,2,1,-1,-2};

    class Point {
        int x,y;
        public Point(int xx, int yy) {
            x=xx; y=yy;
        }
        public double dist(Point p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    class PointL {
        long x,y;
        public PointL(long xx, long yy) {
            x=xx; y=yy;
        }
        public double dist(PointL p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    class PointD {
        double x,y;
        public PointD(double xx, double yy) {
            x=xx; y=yy;
        }
        public double dist(PointD p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    double dist(int x, int y, int xx, int yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }
    double dist(long x, long y, long xx, long yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }
    double dist(double x, double y, double xx, double yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }

    @SuppressWarnings("serial")
    class IncMap extends HashMap<Object, Integer> {
        boolean add(Object key) {
            Integer i = get(key);
            if (i!=null) {
                put(key, i+1);
                return false;
            } else {
                put(key, 1);
                return true;
            }
        }
    }

    int min(int... nums) {
        int r = INF;
        for (int i: nums)
            if (i<r) r = i;
        return r;
    }
    int max(int... nums) {
        int r = -INF;
        for (int i: nums)
            if (i>r) r = i;
        return r;
    }
    long minL(long... nums) {
        long r = INFL;
        for (long i: nums)
            if (i<r) r = i;
        return r;
    }
    long maxL(long... nums) {
        long r = -INFL;
        for (long i: nums)
            if (i>r) r = i;
        return r;
    }

    int digitSum(long i) {
        i = abs(i);
        int r = 0;
        while (i>0) {
            r+=i%10;
            i/=10;
        }
        return r;
    }
    long digitProd(long i) {
        if (i==0) return 0;
        i = abs(i);
        long r = 1;
        while (i>0) {
            r*=i%10;
            i/=10;
        }
        return r;
    }

    double log_2 = log(2);
    double log2(double i) {
        return log(i)/log_2;
    }
    long binpow(int x, int n) {
        long r = 1;
        while (n>0) {
            if ((n&1)!=0) r*=x;
            x*=x;
            n>>=1;
        }
        return r;
    }

    boolean isPalindrome(String s) {
        for (int i=0; i<s.length()/2; i++)
            if (s.charAt(i)!=s.charAt(s.length()-1-i)) return false;
        return true;
    }

    int[] months = {0,31,28,31,30,31,30,31,31,30,31,30,31};
    boolean isLeapYear(int y) {
        return y%4==0 && (y%400==0 || y%100!=0);
    }
    boolean isValidDate(int d, int m, int y) {
        if (isLeapYear(y) && m==2 && d==29) return true;
        return m>0 && m<=12 && d>0 && d<=months[d];
    }
    int[] nextDay(int d, int m, int y) {
        if (d>=months[m])
            if (m==2 && d==28 && isLeapYear(y)) d++;
            else {d=1; m++;}
        else
            d++;
        if (m==13) {d=1; m=1; y++;}
        return new int[] {d,m,y};
    }

    long timer = System.currentTimeMillis();
    void startTimer() {
        timer = System.currentTimeMillis();
    }
    void stopTimer() {
        System.err.println("time: "+(System.currentTimeMillis()-timer)/1000.0);
    }

    static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));

    String nextLine() throws IOException {
        return in.readLine();
    }
    String nextWord() throws IOException {
        StringBuilder sb = new StringBuilder();
        int c = 0;
        while (c<=' ') c=in.read();
        while (c>' ') {
            sb.append((char)c);
            c = in.read();
        }
        return sb.toString();
    }
    int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextWord());
    }
    long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextWord());
    }
    double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextWord());
    }

    void print(Object o) throws IOException {
        out.write(o.toString());
    }
    void println(Object o) throws IOException {
        out.write(o.toString());
        out.newLine();
    }
    void print(Object... o) throws IOException {
        for (int i=0; i<o.length; i++) {
            if (i!=0) out.write(' ');
            out.write(o[i].toString());
        }
    }
    void println(Object... o) throws IOException {
        print(o);
        out.newLine();
    }
    void printArr(int[] arr) throws IOException {
        for (int i=0; i<arr.length; i++) {
            if (i!=0) out.write(' ');
            out.write(Integer.toString(arr[i]));
        }
    }
    void printArr(long[] arr) throws IOException {
        for (int i=0; i<arr.length; i++) {
            if (i!=0) out.write(' ');
            out.write(Long.toString(arr[i]));
        }
    }
    void printArr(double[] arr) throws IOException {
        for (int i=0; i<arr.length; i++) {
            if (i!=0) out.write(' ');
            out.write(Double.toString(arr[i]));
        }
    }
    void printlnArr(int[] arr) throws IOException {
        printArr(arr);
        out.newLine();
    }
    void printlnArr(long[] arr) throws IOException {
        printArr(arr);
        out.newLine();
    }
    void printlnArr(double[] arr) throws IOException {
        printArr(arr);
        out.newLine();
    }

    void debug(Object... o) {
        System.err.println(Arrays.deepToString(o));
    }

    public static void main(String[] args) throws Exception {
        Locale.setDefault(Locale.US);
        new B().solve();
        out.flush();
        out.close(); in.close();
    }
}


import static java.lang.Math.*;

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

public class B {

    public void solve() throws Exception {
        int n = nextInt();
        int m = (n-1)*n/2;

        if (n==2) {
            int k = nextInt();
            print(1,nextInt());
            println();
            print(k-1);
            for (int i=1; i<k; i++)
                print(" "+nextInt());
            println();
            return;
        }

        int[][] poc = new int[210][210];
        TreeSet<Integer> mame = new TreeSet<Integer>();

        for (int i=0; i<m; i++) {
            int k = nextInt();
            TreeSet<Integer> ts = new TreeSet<Integer>();
            for (int j=0; j<k; j++) {
                int cislo = nextInt();
                ts.add(cislo);
                mame.add(cislo);
            }
//          debug(ts.toString());
            for (Integer a: ts) {
                for (Integer b: ts) {
                    if (a!=b) {
                        poc[a][b]++;
                        poc[b][a]++;
                    }
                }
            }
        }

//      for (int[] p: poc)
//          debug(p);

        TreeSet<Integer> bol = new TreeSet<Integer>();
        TreeSet<Integer>[] r = new TreeSet[n];
        for (int i=0; i<n; i++) r[i] = new TreeSet<Integer>();
        int pos = 0;
        for (int i=1; i<=20; i++) {
            boolean b = false;
            for (int j=i; j<=200; j++) {
                if (poc[i][j]==(n-1)*2 && !bol.contains(j)) {
                    r[pos].add(i); r[pos].add(j);
                    bol.add(i); bol.add(j);
                    b=true;
                }
            }
            if (b) pos++;
        }

//      for (TreeSet t: r)
//          debug(t);
//      debug(mame);
//      debug(bol);

        for (Integer vsetky: mame) {
            if (!bol.contains(vsetky)) {
                bol.add(vsetky);
                r[pos++].add(vsetky);
            }
        }

//      for (TreeSet t: r)
//          debug(t);

        for (TreeSet<Integer> set: r) {
            print(set.size());
            for (Integer cislo: set)
                print("",cislo);
            println();
        }

    }

    ////////////////////////////////////////////////////////////////////////////

    double EPS = 1e-7;
    int INF = Integer.MAX_VALUE;
    long INFL = Long.MAX_VALUE;
    double INFD = Double.MAX_VALUE;

    int[] dx = {0,1,0,-1};
    int[] dy = {-1,0,1,0};
    int[] dx8 = {0,1,1,1,0,-1,-1,-1};
    int[] dy8 = {-1,-1,0,1,1,1,0,-1};
    int[] knightMovesX = {1,2,2,1,-1,-2,-2,-1};
    int[] knightMovesY = {-2,-1,1,2,2,1,-1,-2};

    class Point {
        int x,y;
        public Point(int xx, int yy) {
            x=xx; y=yy;
        }
        public double dist(Point p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    class PointL {
        long x,y;
        public PointL(long xx, long yy) {
            x=xx; y=yy;
        }
        public double dist(PointL p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    class PointD {
        double x,y;
        public PointD(double xx, double yy) {
            x=xx; y=yy;
        }
        public double dist(PointD p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    double dist(int x, int y, int xx, int yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }
    double dist(long x, long y, long xx, long yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }
    double dist(double x, double y, double xx, double yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }

    @SuppressWarnings("serial")
    class IncMap extends HashMap<Object, Integer> {
        boolean add(Object key) {
            Integer i = get(key);
            if (i!=null) {
                put(key, i+1);
                return false;
            } else {
                put(key, 1);
                return true;
            }
        }
    }

    int min(int... nums) {
        int r = INF;
        for (int i: nums)
            if (i<r) r = i;
        return r;
    }
    int max(int... nums) {
        int r = -INF;
        for (int i: nums)
            if (i>r) r = i;
        return r;
    }
    long minL(long... nums) {
        long r = INFL;
        for (long i: nums)
            if (i<r) r = i;
        return r;
    }
    long maxL(long... nums) {
        long r = -INFL;
        for (long i: nums)
            if (i>r) r = i;
        return r;
    }

    int digitSum(long i) {
        i = abs(i);
        int r = 0;
        while (i>0) {
            r+=i%10;
            i/=10;
        }
        return r;
    }
    long digitProd(long i) {
        if (i==0) return 0;
        i = abs(i);
        long r = 1;
        while (i>0) {
            r*=i%10;
            i/=10;
        }
        return r;
    }

    double log_2 = log(2);
    double log2(double i) {
        return log(i)/log_2;
    }
    long binpow(int x, int n) {
        long r = 1;
        while (n>0) {
            if ((n&1)!=0) r*=x;
            x*=x;
            n>>=1;
        }
        return r;
    }

    boolean isPalindrome(String s) {
        for (int i=0; i<s.length()/2; i++)
            if (s.charAt(i)!=s.charAt(s.length()-1-i)) return false;
        return true;
    }

    int[] months = {0,31,28,31,30,31,30,31,31,30,31,30,31};
    boolean isLeapYear(int y) {
        return y%4==0 && (y%400==0 || y%100!=0);
    }
    boolean isValidDate(int d, int m, int y) {
        if (isLeapYear(y) && m==2 && d==29) return true;
        return m>0 && m<=12 && d>0 && d<=months[d];
    }
    int[] nextDay(int d, int m, int y) {
        if (d>=months[m])
            if (m==2 && d==28 && isLeapYear(y)) d++;
            else {d=1; m++;}
        else
            d++;
        if (m==13) {d=1; m=1; y++;}
        return new int[] {d,m,y};
    }

    long timer = System.currentTimeMillis();
    void startTimer() {
        timer = System.currentTimeMillis();
    }
    void stopTimer() {
        System.err.println("time: "+(System.currentTimeMillis()-timer)/1000.0);
    }

    static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));

    String nextLine() throws IOException {
        return in.readLine();
    }
    String nextWord() throws IOException {
        StringBuilder sb = new StringBuilder();
        int c = 0;
        while (c<=' ') c=in.read();
        while (c>' ') {
            sb.append((char)c);
            c = in.read();
        }
        return sb.toString();
    }
    int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextWord());
    }
    long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextWord());
    }
    double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextWord());
    }

    void print(Object o) throws IOException {
        out.write(o.toString());
    }
    void println(Object o) throws IOException {
        out.write(o.toString());
        out.newLine();
    }
    void print(Object... o) throws IOException {
        for (int i=0; i<o.length; i++) {
            if (i!=0) out.write(' ');
            out.write(o[i].toString());
        }
    }
    void println(Object... o) throws IOException {
        print(o);
        out.newLine();
    }
    void printArr(int[] arr) throws IOException {
        for (int i=0; i<arr.length; i++) {
            if (i!=0) out.write(' ');
            out.write(Integer.toString(arr[i]));
        }
    }
    void printArr(long[] arr) throws IOException {
        for (int i=0; i<arr.length; i++) {
            if (i!=0) out.write(' ');
            out.write(Long.toString(arr[i]));
        }
    }
    void printArr(double[] arr) throws IOException {
        for (int i=0; i<arr.length; i++) {
            if (i!=0) out.write(' ');
            out.write(Double.toString(arr[i]));
        }
    }
    void printlnArr(int[] arr) throws IOException {
        printArr(arr);
        out.newLine();
    }
    void printlnArr(long[] arr) throws IOException {
        printArr(arr);
        out.newLine();
    }
    void printlnArr(double[] arr) throws IOException {
        printArr(arr);
        out.newLine();
    }

    void debug(Object... o) {
        System.err.println(Arrays.deepToString(o));
    }

    public static void main(String[] args) throws Exception {
        Locale.setDefault(Locale.US);
        new B().solve();
        out.flush();
        out.close(); in.close();
    }
}


import static java.lang.Math.*;

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

public class B {

    public void solve() throws Exception {
        int n = nextInt();
        int m = (n-1)*n/2;

        if (n==2) {
            int k = nextInt();
            print(1,nextInt());
            println();
            print(k-1);
            for (int i=1; i<k; i++)
                print(" "+nextInt());
            println();
            return;
        }

        int[][] poc = new int[210][210];
        TreeSet<Integer> mame = new TreeSet<Integer>();

        for (int i=0; i<m; i++) {
            int k = nextInt();
            TreeSet<Integer> ts = new TreeSet<Integer>();
            for (int j=0; j<k; j++) {
                int cislo = nextInt();
                ts.add(cislo);
                mame.add(cislo);
            }
//          debug(ts.toString());
            for (Integer a: ts) {
                for (Integer b: ts) {
                    if (a!=b) {
                        poc[a][b]++;
                        poc[b][a]++;
                    }
                }
            }
        }

//      for (int[] p: poc)
//          debug(p);

        TreeSet<Integer> bol = new TreeSet<Integer>();
        TreeSet<Integer>[] r = new TreeSet[n];
        for (int i=0; i<n; i++) r[i] = new TreeSet<Integer>();
        int pos = 0;
        for (int i=1; i<=200; i++) {
            boolean b = false;
            for (int j=i; j<=200; j++) {
                if (poc[i][j]==m && !bol.contains(j)) {
                    r[pos].add(i); r[pos].add(j);
                    bol.add(i); bol.add(j);
                    b=true;
                }
            }
            if (b) pos++;
        }

//      for (TreeSet t: r)
//          debug(t);

        for (Integer vsetky: mame) {
            if (!bol.contains(vsetky)) {
                bol.add(vsetky);
                r[pos++].add(vsetky);
            }
        }

//      for (TreeSet t: r)
//          debug(t);

        for (TreeSet<Integer> set: r) {
            print(set.size());
            for (Integer cislo: set)
                print("",cislo);
            println();
        }

    }

    ////////////////////////////////////////////////////////////////////////////

    double EPS = 1e-7;
    int INF = Integer.MAX_VALUE;
    long INFL = Long.MAX_VALUE;
    double INFD = Double.MAX_VALUE;

    int[] dx = {0,1,0,-1};
    int[] dy = {-1,0,1,0};
    int[] dx8 = {0,1,1,1,0,-1,-1,-1};
    int[] dy8 = {-1,-1,0,1,1,1,0,-1};
    int[] knightMovesX = {1,2,2,1,-1,-2,-2,-1};
    int[] knightMovesY = {-2,-1,1,2,2,1,-1,-2};

    class Point {
        int x,y;
        public Point(int xx, int yy) {
            x=xx; y=yy;
        }
        public double dist(Point p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    class PointL {
        long x,y;
        public PointL(long xx, long yy) {
            x=xx; y=yy;
        }
        public double dist(PointL p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    class PointD {
        double x,y;
        public PointD(double xx, double yy) {
            x=xx; y=yy;
        }
        public double dist(PointD p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    double dist(int x, int y, int xx, int yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }
    double dist(long x, long y, long xx, long yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }
    double dist(double x, double y, double xx, double yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }

    @SuppressWarnings("serial")
    class IncMap extends HashMap<Object, Integer> {
        boolean add(Object key) {
            Integer i = get(key);
            if (i!=null) {
                put(key, i+1);
                return false;
            } else {
                put(key, 1);
                return true;
            }
        }
    }

    int min(int... nums) {
        int r = INF;
        for (int i: nums)
            if (i<r) r = i;
        return r;
    }
    int max(int... nums) {
        int r = -INF;
        for (int i: nums)
            if (i>r) r = i;
        return r;
    }
    long minL(long... nums) {
        long r = INFL;
        for (long i: nums)
            if (i<r) r = i;
        return r;
    }
    long maxL(long... nums) {
        long r = -INFL;
        for (long i: nums)
            if (i>r) r = i;
        return r;
    }

    int digitSum(long i) {
        i = abs(i);
        int r = 0;
        while (i>0) {
            r+=i%10;
            i/=10;
        }
        return r;
    }
    long digitProd(long i) {
        if (i==0) return 0;
        i = abs(i);
        long r = 1;
        while (i>0) {
            r*=i%10;
            i/=10;
        }
        return r;
    }

    double log_2 = log(2);
    double log2(double i) {
        return log(i)/log_2;
    }
    long binpow(int x, int n) {
        long r = 1;
        while (n>0) {
            if ((n&1)!=0) r*=x;
            x*=x;
            n>>=1;
        }
        return r;
    }

    boolean isPalindrome(String s) {
        for (int i=0; i<s.length()/2; i++)
            if (s.charAt(i)!=s.charAt(s.length()-1-i)) return false;
        return true;
    }

    int[] months = {0,31,28,31,30,31,30,31,31,30,31,30,31};
    boolean isLeapYear(int y) {
        return y%4==0 && (y%400==0 || y%100!=0);
    }
    boolean isValidDate(int d, int m, int y) {
        if (isLeapYear(y) && m==2 && d==29) return true;
        return m>0 && m<=12 && d>0 && d<=months[d];
    }
    int[] nextDay(int d, int m, int y) {
        if (d>=months[m])
            if (m==2 && d==28 && isLeapYear(y)) d++;
            else {d=1; m++;}
        else
            d++;
        if (m==13) {d=1; m=1; y++;}
        return new int[] {d,m,y};
    }

    long timer = System.currentTimeMillis();
    void startTimer() {
        timer = System.currentTimeMillis();
    }
    void stopTimer() {
        System.err.println("time: "+(System.currentTimeMillis()-timer)/1000.0);
    }

    static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));

    String nextLine() throws IOException {
        return in.readLine();
    }
    String nextWord() throws IOException {
        StringBuilder sb = new StringBuilder();
        int c = 0;
        while (c<=' ') c=in.read();
        while (c>' ') {
            sb.append((char)c);
            c = in.read();
        }
        return sb.toString();
    }
    int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextWord());
    }
    long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextWord());
    }
    double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextWord());
    }

    void print(Object o) throws IOException {
        out.write(o.toString());
    }
    void println(Object o) throws IOException {
        out.write(o.toString());
        out.newLine();
    }
    void print(Object... o) throws IOException {
        for (int i=0; i<o.length; i++) {
            if (i!=0) out.write(' ');
            out.write(o[i].toString());
        }
    }
    void println(Object... o) throws IOException {
        print(o);
        out.newLine();
    }
    void printArr(int[] arr) throws IOException {
        for (int i=0; i<arr.length; i++) {
            if (i!=0) out.write(' ');
            out.write(Integer.toString(arr[i]));
        }
    }
    void printArr(long[] arr) throws IOException {
        for (int i=0; i<arr.length; i++) {
            if (i!=0) out.write(' ');
            out.write(Long.toString(arr[i]));
        }
    }
    void printArr(double[] arr) throws IOException {
        for (int i=0; i<arr.length; i++) {
            if (i!=0) out.write(' ');
            out.write(Double.toString(arr[i]));
        }
    }
    void printlnArr(int[] arr) throws IOException {
        printArr(arr);
        out.newLine();
    }
    void printlnArr(long[] arr) throws IOException {
        printArr(arr);
        out.newLine();
    }
    void printlnArr(double[] arr) throws IOException {
        printArr(arr);
        out.newLine();
    }

    void debug(Object... o) {
        System.err.println(Arrays.deepToString(o));
    }

    public static void main(String[] args) throws Exception {
        Locale.setDefault(Locale.US);
        new B().solve();
        out.flush();
        out.close(); in.close();
    }
}


import java.util.*;

public class Sets {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = n*(n-1) / 2;
        Set<Integer>[] sets = new Set[m];
        Set<Integer> all = new HashSet<Integer>();
        for (int i = 0; i < m; i++) {
            int k = scan.nextInt();
            sets[i] = new HashSet<Integer>();
            while (k--> 0) {
                int x = scan.nextInt();
                sets[i].add(x);
                all.add(x);
            }
        }

        if (n == 2) {
            Object[] a = all.toArray();
            System.out.println(1 + " " + a[0]);
            System.out.print((a.length-1));
            for (int i = 1; i < a.length; i++)
                System.out.print(" " + a[i]);
            System.out.println();

            return;
        }

        Set<Integer> processed = new HashSet<Integer>();
        for (int x : all) {
            if (processed.contains(x))
                continue;

            Set<Integer> f = new HashSet<Integer>(all);
            for (int i = 0; i < m; i++)
                if (sets[i].contains(x))
                    f.retainAll(sets[i]);

            System.out.print(f.size());
            for (int xx : f)
                System.out.print(" " + xx);
            System.out.println();

            processed.addAll(f);
        }
    }
}


import java.util.*;

public class Sets {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = n*(n-1) / 2;
        Set<Integer>[] sets = new Set[m];
        Set<Integer> all = new HashSet<Integer>();
        for (int i = 0; i < m; i++) {
            int k = scan.nextInt();
            sets[i] = new HashSet<Integer>();
            while (k--> 0) {
                int x = scan.nextInt();
                sets[i].add(x);
                all.add(x);
            }
        }

        Set<Integer> processed = new HashSet<Integer>();
        for (int x : all) {
            if (processed.contains(x))
                continue;

            Set<Integer> f = new HashSet<Integer>(all);
            for (int i = 0; i < m; i++)
                if (sets[i].contains(x))
                    f.retainAll(sets[i]);

            System.out.print(f.size());
            for (int xx : f)
                System.out.print(" " + xx);
            System.out.println();

            processed.addAll(f);
        }
    }
}


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Saransh
 */
import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;

public class Main {

    /**
     * @param args the command line arguments
     */

     static int sets[][];
     static boolean adj[][];
     static boolean used[];
    public static void main(String[] args) {
        // TODO code application logic here
        Parserdoubt pd=new Parserdoubt(System.in);
        PrintWriter pw=new PrintWriter(System.out);
        try
        {
            int n=pd.nextInt();
            adj=new boolean[201][201];
            sets=new int[(n*(n-1))/2][];
            used=new boolean[201];
            for(int i=0;i<sets.length;i++)
            {
                int len=pd.nextInt();
                sets[i]=new int[len];
                for(int j=0;j<len;j++)
                {
                    sets[i][j]=pd.nextInt();
                    used[sets[i][j]]=true;
                }
            }
            if(n==2)
            {
                pw.print("1 ");
                pw.println(sets[0][0]);
                pw.print(sets[0].length-1);
                for(int i=1;i<sets[0].length;i++)
                    pw.print(" "+sets[0][i]);
                pw.println();
                pw.flush();
                return;
            }
            for(int i=1;i<=200;i++)
            {
                if(!used[i])continue;
                for(int j=i+1;j<=200;j++)
                {
                    if(!used[j])continue;
                    if(connected(i,j))
                    {
                        adj[i][j]=true;
                        adj[j][i]=true;
                    }
                }
            }
            marked=new boolean[201];
            for(int i=1;i<=200;i++)
            {
                if(used[i]&&!marked[i])
                {
                    print=new HashSet<Integer>();
                    dfs(i);
                    pw.print(print.size());
                Iterator iter=print.iterator();
                while(iter.hasNext())
                {
                    pw.print(" "+iter.next());
                }
                pw.println();
                }

            }
pw.flush();
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }
    public static void dfs(int a)
    {
        if(marked[a])return;
        print.add(a);
        marked[a]=true;
        for(int i=1;i<=200;i++)
        {
            if(adj[a][i])
                dfs(i);
        }
    }
    static HashSet<Integer> print;
    static boolean marked[];
    public static boolean contains(int c,int val)
    {
        for(int i=0;i<sets[c].length;i++)
            if(sets[c][i]==val)
                return true;
        return false;
    }
    public static boolean connected(int a,int b)
    {
        for(int i=0;i<sets.length;i++)
        {

            if(contains(i,a)&&!contains(i,b))
                return false;
            if(!contains(i,a)&&contains(i,b))
                return false;
        }
        return true;

    }
}

class Parserdoubt
    {
       final private int BUFFER_SIZE = 1 << 17;

       private DataInputStream din;
       private byte[] buffer;
       private int bufferPointer, bytesRead;

       public Parserdoubt(InputStream in)
       {
          din = new DataInputStream(in);
          buffer = new byte[BUFFER_SIZE];
          bufferPointer = bytesRead = 0;
       }
       public String nextString() throws Exception
       {
           StringBuffer sb=new StringBuffer("");
           byte c = read();
           while (c <= ' ') c = read();
           do
           {
               sb.append((char)c);
               c=read();
           }while(c>' ');
           return sb.toString();
       }
       public char nextChar() throws Exception
       {
           byte c=read();
           while(c<=' ') c= read();
           return (char)c;
       }
       public int nextInt() throws Exception
       {
          int ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       public long nextLong() throws Exception
       {
          long ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       private void fillBuffer() throws Exception
       {
          bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
          if (bytesRead == -1) buffer[0] = -1;
       }

       private byte read() throws Exception
       {
          if (bufferPointer == bytesRead) fillBuffer();
          return buffer[bufferPointer++];
       }
    }


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Saransh
 */
import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;

public class Main {

    /**
     * @param args the command line arguments
     */

     static int sets[][];
     static boolean adj[][];
     static boolean used[];
    public static void main(String[] args) {
        // TODO code application logic here
        Parserdoubt pd=new Parserdoubt(System.in);
        PrintWriter pw=new PrintWriter(System.out);
        try
        {
            int n=pd.nextInt();
            adj=new boolean[201][201];
            sets=new int[(n*(n-1))/2][];
            used=new boolean[201];
            for(int i=0;i<sets.length;i++)
            {
                int len=pd.nextInt();
                sets[i]=new int[len];
                for(int j=0;j<len;j++)
                {
                    sets[i][j]=pd.nextInt();
                    used[sets[i][j]]=true;
                }
            }
            for(int i=1;i<=200;i++)
            {
                if(!used[i])continue;
                for(int j=i+1;j<=200;j++)
                {
                    if(!used[j])continue;
                    if(connected(i,j))
                    {
                        adj[i][j]=true;
                        adj[j][i]=true;
                    }
                }
            }
            marked=new boolean[201];
            for(int i=1;i<=200;i++)
            {
                if(used[i]&&!marked[i])
                {
                    print=new HashSet<Integer>();
                    dfs(i);
                    pw.print(print.size());
                Iterator iter=print.iterator();
                while(iter.hasNext())
                {
                    pw.print(" "+iter.next());
                }
                pw.println();
                }

            }
pw.flush();
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }
    public static void dfs(int a)
    {
        if(marked[a])return;
        print.add(a);
        marked[a]=true;
        for(int i=1;i<=200;i++)
        {
            if(adj[a][i])
                dfs(i);
        }
    }
    static HashSet<Integer> print;
    static boolean marked[];
    public static boolean contains(int c,int val)
    {
        for(int i=0;i<sets[c].length;i++)
            if(sets[c][i]==val)
                return true;
        return false;
    }
    public static boolean connected(int a,int b)
    {
        for(int i=0;i<sets.length;i++)
        {

            if(contains(i,a)&&!contains(i,b))
                return false;
            if(!contains(i,a)&&contains(i,b))
                return false;
        }
        return true;

    }
}

class Parserdoubt
    {
       final private int BUFFER_SIZE = 1 << 17;

       private DataInputStream din;
       private byte[] buffer;
       private int bufferPointer, bytesRead;

       public Parserdoubt(InputStream in)
       {
          din = new DataInputStream(in);
          buffer = new byte[BUFFER_SIZE];
          bufferPointer = bytesRead = 0;
       }
       public String nextString() throws Exception
       {
           StringBuffer sb=new StringBuffer("");
           byte c = read();
           while (c <= ' ') c = read();
           do
           {
               sb.append((char)c);
               c=read();
           }while(c>' ');
           return sb.toString();
       }
       public char nextChar() throws Exception
       {
           byte c=read();
           while(c<=' ') c= read();
           return (char)c;
       }
       public int nextInt() throws Exception
       {
          int ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       public long nextLong() throws Exception
       {
          long ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       private void fillBuffer() throws Exception
       {
          bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
          if (bytesRead == -1) buffer[0] = -1;
       }

       private byte read() throws Exception
       {
          if (bufferPointer == bytesRead) fillBuffer();
          return buffer[bufferPointer++];
       }
    }


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

/**
 *
 * @author dima
 */
public class Main {

    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok;

    public static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            String rl = in.readLine();
            if (rl == null) {
                return null;
            }
            tok = new StringTokenizer(rl);
        }
        return tok.nextToken();
    }

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

    public static void main(String[] args) throws IOException {

        int n = 0, N;
        n = nextInt();
        N = n * (n - 1) / 2;
        int[][] inMas = new int[N + 10][250];
        ArrayList[] res = new ArrayList[n + 1500];

        for (int i = 0; i < N; i++) {
            int k = nextInt();

            for (int j = 0; j < k; j++) {
                int inInt = nextInt();
                inMas[i][inInt] = 1;
            }
        }
        int k = 0;
        ArrayList rrr = null;

        for (int i = 0; i < N; i++) {
            res[k++] = createSet(i, inMas);
            rrr = new ArrayList(250);
            for (int j = 1; j <= 200; j++) {
                if (inMas[i][j] == 1) {
                    rrr.add(j);
                }
            }
            if (rrr.size() != 0) {
                res[k++] = rrr;
            }

            for (int[] m : inMas) {
                for (Object is : rrr) {
                    int ii = (Integer) is;
                    m[ii] = 0;
                }
            }
        }
        //if(n==10){
        //    System.out.println(N+" "+k+" "+rrr.size());
        //} else
        for (int i = 0; i < res.length; i++) {
            ArrayList arrayList = res[i];
            if (arrayList!=null&&arrayList.size() != 0) {
                System.out.println();
                System.out.print(arrayList.size() + " ");
            }
            if (arrayList!=null&&arrayList.size() != 0)
            for (Object object : arrayList) {
                System.out.print((Integer) object + " ");
            }
        }

    }

    public static boolean find(int a, int[][] mas, ArrayList rr, int ind) {
        boolean res = false;
        for (int j = ind + 1; j < mas.length; j++) {
            int[] is = mas[j];
            if (is[a] != 0) {
                boolean promej = true;
                for (Object i : rr) {
                    Integer ii = (Integer) i;
                    if (is[ii] == 0) {
                        promej = false;
                    } else {
                    }
                }
                if (promej) {
                    res = true;
                    is[a] = -1;
                }
            }

        }
        return res;
    }

    public static ArrayList createSet(int index, int[][] mas) {
        ArrayList res = new ArrayList<Integer>(250);
        for (int i = 1; i <= 200; i++) {
            if (mas[index][i] != 0) {
                int dig = i;
                boolean find = find(dig, mas, res, index);
                if (find) {
                    res.add(dig);
                    mas[index][dig] = -1;
                }
            }
        }
        for (int[] m : mas) {
            for (Object i : res) {
                int ii = (Integer) i;
                m[ii] = 0;
            }
        }
        return res;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

/**
 *
 * @author dima
 */
public class Main {

    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok;

    public static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            String rl = in.readLine();
            if (rl == null) {
                return null;
            }
            tok = new StringTokenizer(rl);
        }
        return tok.nextToken();
    }

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

    public static void main(String[] args) throws IOException {

        int n = 0, N;
        n = nextInt();
        N = n * (n - 1) / 2;
        int[][] inMas = new int[N + 1][202];
        ArrayList[] res = new ArrayList[n + 1];

        for (int i = 0; i < N; i++) {
            int k = nextInt();

            for (int j = 0; j < k; j++) {
                int inInt = nextInt();
                inMas[i][inInt] = 1;
            }
        }
        int k = 0;
        ArrayList rrr = null;

        for (int i = 0; i < n; i++) {
            res[k++] = createSet(i, inMas);
            rrr = new ArrayList(250);
            for (int j = 1; j <= 200; j++) {
                if (inMas[i][j] == 1) {
                    rrr.add(j);
                }
            }
            if (rrr.size() != 0) {
                res[k++] = rrr;
            }

            for (int[] m : inMas) {
                for (Object is : rrr) {
                    int ii = (Integer) is;
                    m[ii] = 0;
                }
            }
        }

        for (int i = 0; i < n; i++) {
            ArrayList arrayList = res[i];
            if (arrayList.size() != 0) {
                System.out.println();
                System.out.print(arrayList.size() + " ");
            }
            for (Object object : arrayList) {
                System.out.print((Integer) object + " ");
            }
        }

    }

    public static boolean find(int a, int[][] mas, ArrayList rr, int ind) {
        boolean res = false;
        for (int j = ind + 1; j < mas.length; j++) {
            int[] is = mas[j];
            if (is[a] != 0) {
                boolean promej = true;
                for (Object i : rr) {
                    Integer ii = (Integer) i;
                    if (is[ii] == 0) {
                        promej = false;
                    } else {
                    }
                }
                if (promej) {
                    res = true;
                    is[a] = -1;
                }
            }

        }
        return res;
    }

    public static ArrayList createSet(int index, int[][] mas) {
        ArrayList res = new ArrayList<Integer>(250);
        for (int i = 1; i <= 200; i++) {
            if (mas[index][i] != 0) {
                int dig = i;
                boolean find = find(dig, mas, res, index);
                if (find) {
                    res.add(dig);
                    mas[index][dig] = -1;
                }
            }
        }
        for (int[] m : mas) {
            for (Object i : res) {
                int ii = (Integer) i;
                m[ii] = 0;
            }
        }
        return res;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

/**
 *
 * @author dima
 */
public class Main {

    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok;

    public static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            String rl = in.readLine();
            if (rl == null) {
                return null;
            }
            tok = new StringTokenizer(rl);
        }
        return tok.nextToken();
    }

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

    public static void main(String[] args) throws IOException {

        int n = 0, N;
        n = nextInt();
        N = n * (n - 1) / 2;
        int[][] inMas = new int[N + 10][250];
        ArrayList[] res = new ArrayList[n + 4500];

        for (int i = 0; i < N; i++) {
            int k = nextInt();

            for (int j = 0; j < k; j++) {
                int inInt = nextInt();
                inMas[i][inInt] = 1;
            }
        }
        int k = 0;
        ArrayList rrr = null;

        for (int i = 0; i < N; i++) {
            res[k++] = createSet(i, inMas);
            rrr = new ArrayList(2500);
            for (int j = 1; j <= 200; j++) {
                if (inMas[i][j] == 1) {
                    rrr.add(j);
                }
            }
            if (rrr.size() != 0) {
                res[k++] = rrr;
            }

            for (int[] m : inMas) {
                for (Object is : rrr) {
                    int ii = (Integer) is;
                    m[ii] = 0;
                }
            }
        }
        //if(n==10){
        //    System.out.println(N+" "+k+" "+rrr.size());
        //} else
        for (int i = 0; i < res.length; i++) {
            ArrayList arrayList = res[i];
            if (arrayList!=null&&arrayList.size() != 0) {
                System.out.println();
                System.out.print(arrayList.size() + " ");
            }
            if (arrayList!=null&&arrayList.size() != 0)
            for (Object object : arrayList) {
                System.out.print((Integer) object + " ");
            }
        }

    }

    public static boolean find(int a, int[][] mas, ArrayList rr, int ind) {
        boolean res = false;
        for (int j = ind + 1; j < mas.length; j++) {
            int[] is = mas[j];
            if (is[a] != 0) {
                boolean promej = true;
                for (Object i : rr) {
                    Integer ii = (Integer) i;
                    if (is[ii] == 0) {
                        promej = false;
                    } else {
                    }
                }
                if (promej) {
                    res = true;
                    is[a] = -1;
                }
            }

        }
        return res;
    }

    public static ArrayList createSet(int index, int[][] mas) {
        ArrayList res = new ArrayList<Integer>(250);
        for (int i = 1; i <= 200; i++) {
            if (mas[index][i] != 0) {
                int dig = i;
                boolean find = find(dig, mas, res, index);
                if (find) {
                    res.add(dig);
                    mas[index][dig] = -1;
                }
            }
        }
        for (int[] m : mas) {
            for (Object i : res) {
                int ii = (Integer) i;
                m[ii] = 0;
            }
        }
        return res;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

/**
 *
 * @author dima
 */
public class Main {

    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok;

    public static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            String rl = in.readLine();
            if (rl == null) {
                return null;
            }
            tok = new StringTokenizer(rl);
        }
        return tok.nextToken();
    }

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

    public static void main(String[] args) throws IOException {

        int n = 0, N;
        n = nextInt();
        N = n * (n - 1) / 2;
        int[][] inMas = new int[N + 1][202];
        ArrayList[] res = new ArrayList[n + 1];

        for (int i = 0; i < N; i++) {
            int k = nextInt();

            for (int j = 0; j < k; j++) {
                int inInt = nextInt();
                inMas[i][inInt] = 1;
            }
        }
        int k = 0;
        ArrayList rrr = null;

        for (int i = 0; i < n; i++) {
            res[k++] = createSet(i, inMas);
            rrr = new ArrayList(250);
            for (int j = 1; j <= 200; j++) {
                if (inMas[i][j] == 1) {
                    rrr.add(j);
                }
            }
            if (rrr.size() != 0) {
                res[k++] = rrr;
            }

            for (int[] m : inMas) {
                for (Object is : rrr) {
                    int ii = (Integer) is;
                    m[ii] = 0;
                }
            }
        }

        for (int i = 0; i < k; i++) {
            ArrayList arrayList = res[i];
            if (arrayList.size() != 0) {
                System.out.println();
                System.out.print(arrayList.size() + " ");
            }
            for (Object object : arrayList) {
                System.out.print((Integer) object + " ");
            }
        }

    }

    public static boolean find(int a, int[][] mas, ArrayList rr, int ind) {
        boolean res = false;
        for (int j = ind + 1; j < mas.length; j++) {
            int[] is = mas[j];
            if (is[a] != 0) {
                boolean promej = true;
                for (Object i : rr) {
                    Integer ii = (Integer) i;
                    if (is[ii] == 0) {
                        promej = false;
                    } else {
                    }
                }
                if (promej) {
                    res = true;
                    is[a] = -1;
                }
            }

        }
        return res;
    }

    public static ArrayList createSet(int index, int[][] mas) {
        ArrayList res = new ArrayList<Integer>(250);
        for (int i = 1; i <= 200; i++) {
            if (mas[index][i] != 0) {
                int dig = i;
                boolean find = find(dig, mas, res, index);
                if (find) {
                    res.add(dig);
                    mas[index][dig] = -1;
                }
            }
        }
        for (int[] m : mas) {
            for (Object i : res) {
                int ii = (Integer) i;
                m[ii] = 0;
            }
        }
        return res;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

/**
 *
 * @author dima
 */
public class Main {

    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok;

    public static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            String rl = in.readLine();
            if (rl == null) {
                return null;
            }
            tok = new StringTokenizer(rl);
        }
        return tok.nextToken();
    }

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

    public static void main(String[] args) throws IOException {

        int n = 0, N;
        n = nextInt();
        N = n * (n - 1) / 2;
        int[][] inMas = new int[N + 1][202];
        ArrayList[] res = new ArrayList[n + 50];

        for (int i = 0; i < N; i++) {
            int k = nextInt();

            for (int j = 0; j < k; j++) {
                int inInt = nextInt();
                inMas[i][inInt] = 1;
            }
        }
        int k = 0;
        ArrayList rrr = null;

        for (int i = 0; i < N; i++) {
            res[k++] = createSet(i, inMas);
            rrr = new ArrayList(250);
            for (int j = 1; j <= 200; j++) {
                if (inMas[i][j] == 1) {
                    rrr.add(j);
                }
            }
            if (rrr.size() != 0) {
                res[k++] = rrr;
            }

            for (int[] m : inMas) {
                for (Object is : rrr) {
                    int ii = (Integer) is;
                    m[ii] = 0;
                }
            }
        }
        //if(n==10){
        //    System.out.println(N+" "+k+" "+rrr.size());
        //} else
        for (int i = 0; i < res.length; i++) {
            ArrayList arrayList = res[i];
            if (arrayList!=null&&arrayList.size() != 0) {
                System.out.println();
                System.out.print(arrayList.size() + " ");
            }
            if (arrayList!=null&&arrayList.size() != 0)
            for (Object object : arrayList) {
                System.out.print((Integer) object + " ");
            }
        }

    }

    public static boolean find(int a, int[][] mas, ArrayList rr, int ind) {
        boolean res = false;
        for (int j = ind + 1; j < mas.length; j++) {
            int[] is = mas[j];
            if (is[a] != 0) {
                boolean promej = true;
                for (Object i : rr) {
                    Integer ii = (Integer) i;
                    if (is[ii] == 0) {
                        promej = false;
                    } else {
                    }
                }
                if (promej) {
                    res = true;
                    is[a] = -1;
                }
            }

        }
        return res;
    }

    public static ArrayList createSet(int index, int[][] mas) {
        ArrayList res = new ArrayList<Integer>(250);
        for (int i = 1; i <= 200; i++) {
            if (mas[index][i] != 0) {
                int dig = i;
                boolean find = find(dig, mas, res, index);
                if (find) {
                    res.add(dig);
                    mas[index][dig] = -1;
                }
            }
        }
        for (int[] m : mas) {
            for (Object i : res) {
                int ii = (Integer) i;
                m[ii] = 0;
            }
        }
        return res;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

/**
 *
 * @author dima
 */
public class Main {

    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok;

    public static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            String rl = in.readLine();
            if (rl == null) {
                return null;
            }
            tok = new StringTokenizer(rl);
        }
        return tok.nextToken();
    }

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

    public static void main(String[] args) throws IOException {

        int n = 0, N;
        n = nextInt();
        N = n * (n - 1) / 2;
        int[][] inMas = new int[N + 1][202];
        ArrayList[] res = new ArrayList[n + 1];

        for (int i = 0; i < N; i++) {
            int k = nextInt();

            for (int j = 0; j < k; j++) {
                int inInt = nextInt();
                inMas[i][inInt] = 1;
            }
        }
        int k = 0;
        ArrayList rrr = null;

        for (int i = 0; i < n; i++) {
            res[k++] = createSet(i, inMas);
            rrr = new ArrayList(250);
            for (int j = 1; j <= 200; j++) {
                if (inMas[i][j] == 1) {
                    rrr.add(j);
                }
            }
            if (rrr.size() != 0) {
                res[k++] = rrr;
            }

            for (int[] m : inMas) {
                for (Object is : rrr) {
                    int ii = (Integer) is;
                    m[ii] = 0;
                }
            }
        }

        for (int i = 0; i < res.length; i++) {
            ArrayList arrayList = res[i];
            if (arrayList.size() != 0) {
                System.out.println();
                System.out.print(arrayList.size() + " ");
            }
            for (Object object : arrayList) {
                System.out.print((Integer) object + " ");
            }
        }

    }

    public static boolean find(int a, int[][] mas, ArrayList rr, int ind) {
        boolean res = false;
        for (int j = ind + 1; j < mas.length; j++) {
            int[] is = mas[j];
            if (is[a] != 0) {
                boolean promej = true;
                for (Object i : rr) {
                    Integer ii = (Integer) i;
                    if (is[ii] == 0) {
                        promej = false;
                    } else {
                    }
                }
                if (promej) {
                    res = true;
                    is[a] = -1;
                }
            }

        }
        return res;
    }

    public static ArrayList createSet(int index, int[][] mas) {
        ArrayList res = new ArrayList<Integer>(250);
        for (int i = 1; i <= 200; i++) {
            if (mas[index][i] != 0) {
                int dig = i;
                boolean find = find(dig, mas, res, index);
                if (find) {
                    res.add(dig);
                    mas[index][dig] = -1;
                }
            }
        }
        for (int[] m : mas) {
            for (Object i : res) {
                int ii = (Integer) i;
                m[ii] = 0;
            }
        }
        return res;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

/**
 *
 * @author dima
 */
public class Main {

    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok;

    public static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            String rl = in.readLine();
            if (rl == null) {
                return null;
            }
            tok = new StringTokenizer(rl);
        }
        return tok.nextToken();
    }

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

    public static void main(String[] args) throws IOException {

        int n = 0, N;
        n = nextInt();
        N = n * (n - 1) / 2;
        int[][] inMas = new int[N + 1][202];
        ArrayList[] res = new ArrayList[n + 1];

        for (int i = 0; i < N; i++) {
            int k = nextInt();

            for (int j = 0; j < k; j++) {
                int inInt = nextInt();
                inMas[i][inInt] = 1;
            }
        }
        int k = 0;
        ArrayList rrr = null;

        for (int i = 0; i < n; i++) {
            res[k++] = createSet(i, inMas);
            rrr = new ArrayList(250);
            for (int j = 1; j <= 200; j++) {
                if (inMas[i][j] == 1) {
                    rrr.add(j);
                }
            }
            if (rrr.size() != 0) {
                res[k++] = rrr;
            }

            for (int[] m : inMas) {
                for (Object is : rrr) {
                    int ii = (Integer) is;
                    m[ii] = 0;
                }
            }
        }
        if(n==10){
            System.out.println(N+" "+k+" "+rrr.size());
        } else
        for (int i = 0; i < res.length; i++) {
            ArrayList arrayList = res[i];
            if (arrayList.size() != 0) {
                System.out.println();
                System.out.print(arrayList.size() + " ");
            }
            for (Object object : arrayList) {
                System.out.print((Integer) object + " ");
            }
        }

    }

    public static boolean find(int a, int[][] mas, ArrayList rr, int ind) {
        boolean res = false;
        for (int j = ind + 1; j < mas.length; j++) {
            int[] is = mas[j];
            if (is[a] != 0) {
                boolean promej = true;
                for (Object i : rr) {
                    Integer ii = (Integer) i;
                    if (is[ii] == 0) {
                        promej = false;
                    } else {
                    }
                }
                if (promej) {
                    res = true;
                    is[a] = -1;
                }
            }

        }
        return res;
    }

    public static ArrayList createSet(int index, int[][] mas) {
        ArrayList res = new ArrayList<Integer>(250);
        for (int i = 1; i <= 200; i++) {
            if (mas[index][i] != 0) {
                int dig = i;
                boolean find = find(dig, mas, res, index);
                if (find) {
                    res.add(dig);
                    mas[index][dig] = -1;
                }
            }
        }
        for (int[] m : mas) {
            for (Object i : res) {
                int ii = (Integer) i;
                m[ii] = 0;
            }
        }
        return res;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.StringTokenizer;

/**
 *
 * @author dima
 */
public class Main {

    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok;

    public static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            String rl = in.readLine();
            if (rl == null) {
                return null;
            }
            tok = new StringTokenizer(rl);
        }
        return tok.nextToken();
    }

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

    public static void main(String[] args) throws IOException {

        int n = 0, N;
        n = nextInt();
        N = n * (n - 1) / 2;
        int[][] inMas = new int[N + 10][250];
        ArrayList[] res = new ArrayList[N + 4500];
        ArrayList[] digToInd = new ArrayList[250];
        int k = 0;
        for (int i = 0; i < N; i++) {
            k = nextInt();

            for (int j = 0; j < k; j++) {
                int inInt = nextInt();
                inMas[i][inInt] = 1;

                if (digToInd[inInt] == null) {
                    digToInd[inInt] = new ArrayList(203);
                    digToInd[inInt].add(i);
                } else {
                    digToInd[inInt].add(i);
                }
            }
        }

        if(n==2){
            System.out.print(k/2+" ");
            int t = k/2;
            int j = 0;
            for(j = 0;j<=200;j++){
                if(t==0) break;
                if(inMas[0][j]==1){
                    System.out.print(j+" ");
                    t--;
                }
            }
            int u = j;
            t = k-k/2;
            System.out.println();
            System.out.print(t+" ");
            for(u = j;u<=200;u++){
                if(t==0) break;
                if(inMas[0][u]==1){
                    System.out.print(u+" ");
                    t--;
                }
            }
            return;
        }
        k = 0;
        for (int ind = 0; ind < N; ind++) {
            res[k++] = getSet(ind, inMas, digToInd);
            for (int i = 1; i <= 200; i++) {
                if (inMas[ind][i] == 1) {
                    if (res[k] == null) {
                        res[k] = new ArrayList<Integer>();
                        res[k].add(i);
                    } else {
                        res[k].add(i);
                    }
                }

            }
            if (res[k] != null && res[k].size() != 0) {
                k++;
            }
        }
        HashMap<ArrayList,Integer> ttt = new HashMap<ArrayList,Integer>();
        for (int i = 0; i < res.length; i++) {
            if (res[i] != null && res[i].size() != 0&&(!ttt.containsKey(res[i]))) {
                System.out.println();

                ArrayList<Integer> viv = res[i];
                ttt.put(viv, 1);
                System.out.print(viv.size()+" ");
                for (Integer integer : viv) {
                    System.out.print(integer + " ");
                }
            }
        }
    }

    public static ArrayList getSet(int ind, int[][] mas, ArrayList[] digToInd) {
        ArrayList<Integer> res = new ArrayList<Integer>(200);

        for (int dig = 1; dig <= 200; dig++) {
            boolean re = false;
            if (mas[ind][dig] != 0) {

                for (Object object : digToInd[dig]) {
                    int indJ = (Integer) object;
                    if (indJ > ind) {
                        mas[indJ][dig] = -1;
                        re = true;
                        for (Integer dig1 : res) {
                            if (mas[indJ][dig1] == 0) {
                                re = false;
                                break;
                            }
                        }

                    }
                }
                if (re) {
                    mas[ind][dig] = 0;
                    res.add(dig);
                }
            }
        }
        if (res.size() != 0) {
            return res;
        } else {
            return null;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

/**
 *
 * @author dima
 */
public class Main {

    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok;

    public static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            String rl = in.readLine();
            if (rl == null) {
                return null;
            }
            tok = new StringTokenizer(rl);
        }
        return tok.nextToken();
    }

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

    public static void main(String[] args) throws IOException {

        int n = 0, N;
        n = nextInt();
        N = n * (n - 1) / 2;
        int[][] inMas = new int[N + 1][202];
        ArrayList[] res = new ArrayList[n + 2];

        for (int i = 0; i < N; i++) {
            int k = nextInt();

            for (int j = 0; j < k; j++) {
                int inInt = nextInt();
                inMas[i][inInt] = 1;
            }
        }
        int k = 0;
        ArrayList rrr = null;

        for (int i = 0; i < n; i++) {
            res[k++] = createSet(i, inMas);
            rrr = new ArrayList(250);
            for (int j = 1; j <= 200; j++) {
                if (inMas[i][j] == 1) {
                    rrr.add(j);
                }
            }
            if (rrr.size() != 0) {
                res[k++] = rrr;
            }

            for (int[] m : inMas) {
                for (Object is : rrr) {
                    int ii = (Integer) is;
                    m[ii] = 0;
                }
            }
        }
        //if(n==10){
        //    System.out.println(N+" "+k+" "+rrr.size());
        //} else
        for (int i = 0; i < res.length; i++) {
            ArrayList arrayList = res[i];
            if (arrayList!=null&&arrayList.size() != 0) {
                System.out.println();
                System.out.print(arrayList.size() + " ");
            }
            for (Object object : arrayList) {
                System.out.print((Integer) object + " ");
            }
        }

    }

    public static boolean find(int a, int[][] mas, ArrayList rr, int ind) {
        boolean res = false;
        for (int j = ind + 1; j < mas.length; j++) {
            int[] is = mas[j];
            if (is[a] != 0) {
                boolean promej = true;
                for (Object i : rr) {
                    Integer ii = (Integer) i;
                    if (is[ii] == 0) {
                        promej = false;
                    } else {
                    }
                }
                if (promej) {
                    res = true;
                    is[a] = -1;
                }
            }

        }
        return res;
    }

    public static ArrayList createSet(int index, int[][] mas) {
        ArrayList res = new ArrayList<Integer>(250);
        for (int i = 1; i <= 200; i++) {
            if (mas[index][i] != 0) {
                int dig = i;
                boolean find = find(dig, mas, res, index);
                if (find) {
                    res.add(dig);
                    mas[index][dig] = -1;
                }
            }
        }
        for (int[] m : mas) {
            for (Object i : res) {
                int ii = (Integer) i;
                m[ii] = 0;
            }
        }
        return res;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

/**
 *
 * @author dima
 */
public class Main {

    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok;

    public static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            String rl = in.readLine();
            if (rl == null) {
                return null;
            }
            tok = new StringTokenizer(rl);
        }
        return tok.nextToken();
    }

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

    public static void main(String[] args) throws IOException {

        int n = 0, N;
        n = nextInt();
        N = n * (n - 1) / 2;
        int[][] inMas = new int[N + 10][250];
        ArrayList[] res = new ArrayList[n + 150];

        for (int i = 0; i < N; i++) {
            int k = nextInt();

            for (int j = 0; j < k; j++) {
                int inInt = nextInt();
                inMas[i][inInt] = 1;
            }
        }
        int k = 0;
        ArrayList rrr = null;

        for (int i = 0; i < N; i++) {
            res[k++] = createSet(i, inMas);
            rrr = new ArrayList(250);
            for (int j = 1; j <= 200; j++) {
                if (inMas[i][j] == 1) {
                    rrr.add(j);
                }
            }
            if (rrr.size() != 0) {
                res[k++] = rrr;
            }

            for (int[] m : inMas) {
                for (Object is : rrr) {
                    int ii = (Integer) is;
                    m[ii] = 0;
                }
            }
        }
        //if(n==10){
        //    System.out.println(N+" "+k+" "+rrr.size());
        //} else
        for (int i = 0; i < res.length; i++) {
            ArrayList arrayList = res[i];
            if (arrayList!=null&&arrayList.size() != 0) {
                System.out.println();
                System.out.print(arrayList.size() + " ");
            }
            if (arrayList!=null&&arrayList.size() != 0)
            for (Object object : arrayList) {
                System.out.print((Integer) object + " ");
            }
        }

    }

    public static boolean find(int a, int[][] mas, ArrayList rr, int ind) {
        boolean res = false;
        for (int j = ind + 1; j < mas.length; j++) {
            int[] is = mas[j];
            if (is[a] != 0) {
                boolean promej = true;
                for (Object i : rr) {
                    Integer ii = (Integer) i;
                    if (is[ii] == 0) {
                        promej = false;
                    } else {
                    }
                }
                if (promej) {
                    res = true;
                    is[a] = -1;
                }
            }

        }
        return res;
    }

    public static ArrayList createSet(int index, int[][] mas) {
        ArrayList res = new ArrayList<Integer>(250);
        for (int i = 1; i <= 200; i++) {
            if (mas[index][i] != 0) {
                int dig = i;
                boolean find = find(dig, mas, res, index);
                if (find) {
                    res.add(dig);
                    mas[index][dig] = -1;
                }
            }
        }
        for (int[] m : mas) {
            for (Object i : res) {
                int ii = (Integer) i;
                m[ii] = 0;
            }
        }
        return res;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

/**
 *
 * @author dima
 */
public class Main {

    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok;

    public static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            String rl = in.readLine();
            if (rl == null) {
                return null;
            }
            tok = new StringTokenizer(rl);
        }
        return tok.nextToken();
    }

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

    public static void main(String[] args) throws IOException {

        int n = 0, N;
        n = nextInt();
        N = n * (n - 1) / 2;
        int[][] inMas = new int[N + 1][202];
        ArrayList[] res = new ArrayList[n + 2];

        for (int i = 0; i < N; i++) {
            int k = nextInt();

            for (int j = 0; j < k; j++) {
                int inInt = nextInt();
                inMas[i][inInt] = 1;
            }
        }
        int k = 0;
        ArrayList rrr = null;

        for (int i = 0; i < n; i++) {
            res[k++] = createSet(i, inMas);
            rrr = new ArrayList(250);
            for (int j = 1; j <= 200; j++) {
                if (inMas[i][j] == 1) {
                    rrr.add(j);
                }
            }
            if (rrr.size() != 0) {
                res[k++] = rrr;
            }

            for (int[] m : inMas) {
                for (Object is : rrr) {
                    int ii = (Integer) is;
                    m[ii] = 0;
                }
            }
        }
        //if(n==10){
        //    System.out.println(N+" "+k+" "+rrr.size());
        //} else
        for (int i = 0; i < res.length; i++) {
            ArrayList arrayList = res[i];
            if (arrayList!=null&&arrayList.size() != 0) {
                System.out.println();
                System.out.print(arrayList.size() + " ");
            }
            if (arrayList!=null&&arrayList.size() != 0)
            for (Object object : arrayList) {
                System.out.print((Integer) object + " ");
            }
        }

    }

    public static boolean find(int a, int[][] mas, ArrayList rr, int ind) {
        boolean res = false;
        for (int j = ind + 1; j < mas.length; j++) {
            int[] is = mas[j];
            if (is[a] != 0) {
                boolean promej = true;
                for (Object i : rr) {
                    Integer ii = (Integer) i;
                    if (is[ii] == 0) {
                        promej = false;
                    } else {
                    }
                }
                if (promej) {
                    res = true;
                    is[a] = -1;
                }
            }

        }
        return res;
    }

    public static ArrayList createSet(int index, int[][] mas) {
        ArrayList res = new ArrayList<Integer>(250);
        for (int i = 1; i <= 200; i++) {
            if (mas[index][i] != 0) {
                int dig = i;
                boolean find = find(dig, mas, res, index);
                if (find) {
                    res.add(dig);
                    mas[index][dig] = -1;
                }
            }
        }
        for (int[] m : mas) {
            for (Object i : res) {
                int ii = (Integer) i;
                m[ii] = 0;
            }
        }
        return res;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.StringTokenizer;

/**
 *
 * @author dima
 */
public class Main {

    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok;

    public static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            String rl = in.readLine();
            if (rl == null) {
                return null;
            }
            tok = new StringTokenizer(rl);
        }
        return tok.nextToken();
    }

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

    public static void main(String[] args) throws IOException {

        int n = 0, N;
        n = nextInt();
        N = n * (n - 1) / 2;
        int[][] inMas = new int[N + 10][250];
        ArrayList[] res = new ArrayList[N + 4500];
        ArrayList[] digToInd = new ArrayList[250];

        for (int i = 0; i < N; i++) {
            int k = nextInt();

            for (int j = 0; j < k; j++) {
                int inInt = nextInt();
                inMas[i][inInt] = 1;

                if (digToInd[inInt] == null) {
                    digToInd[inInt] = new ArrayList(203);
                    digToInd[inInt].add(i);
                } else {
                    digToInd[inInt].add(i);
                }
            }
        }
        int k = 0;

        for (int ind = 0; ind < N; ind++) {
            res[k++] = getSet(ind, inMas, digToInd);
            for (int i = 1; i <= 200; i++) {
                if (inMas[ind][i] == 1) {
                    if (res[k] == null) {
                        res[k] = new ArrayList<Integer>();
                        res[k].add(i);
                    } else {
                        res[k].add(i);
                    }
                }

            }
            if (res[k] != null && res[k].size() != 0) {
                k++;
            }
        }
        HashMap<ArrayList,Integer> ttt = new HashMap<ArrayList,Integer>();
        for (int i = 0; i < res.length; i++) {
            if (res[i] != null && res[i].size() != 0&&(!ttt.containsKey(res[i]))) {
                System.out.println();

                ArrayList<Integer> viv = res[i];
                ttt.put(viv, 1);
                System.out.print(viv.size()+" ");
                for (Integer integer : viv) {
                    System.out.print(integer + " ");
                }
            }
        }
    }

    public static ArrayList getSet(int ind, int[][] mas, ArrayList[] digToInd) {
        ArrayList<Integer> res = new ArrayList<Integer>(200);

        for (int dig = 1; dig <= 200; dig++) {
            boolean re = false;
            if (mas[ind][dig] != 0) {

                for (Object object : digToInd[dig]) {
                    int indJ = (Integer) object;
                    if (indJ > ind) {
                        mas[indJ][dig] = -1;
                        re = true;
                        for (Integer dig1 : res) {
                            if (mas[indJ][dig1] == 0) {
                                re = false;
                                break;
                            }
                        }

                    }
                }
                if (re) {
                    mas[ind][dig] = 0;
                    res.add(dig);
                }
            }
        }
        if (res.size() != 0) {
            return res;
        } else {
            return null;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

/**
 *
 * @author dima
 */
public class Main {

    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok;

    public static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            String rl = in.readLine();
            if (rl == null) {
                return null;
            }
            tok = new StringTokenizer(rl);
        }
        return tok.nextToken();
    }

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

    public static void main(String[] args) throws IOException {

        int n = 0, N;
        n = nextInt();
        N = n * (n - 1) / 2;
        int[][] inMas = new int[N + 1][202];
        ArrayList[] res = new ArrayList[n + 15];

        for (int i = 0; i < N; i++) {
            int k = nextInt();

            for (int j = 0; j < k; j++) {
                int inInt = nextInt();
                inMas[i][inInt] = 1;
            }
        }
        int k = 0;
        ArrayList rrr = null;

        for (int i = 0; i < n; i++) {
            res[k++] = createSet(i, inMas);
            rrr = new ArrayList(250);
            for (int j = 1; j <= 200; j++) {
                if (inMas[i][j] == 1) {
                    rrr.add(j);
                }
            }
            if (rrr.size() != 0) {
                res[k++] = rrr;
            }

            for (int[] m : inMas) {
                for (Object is : rrr) {
                    int ii = (Integer) is;
                    m[ii] = 0;
                }
            }
        }
        //if(n==10){
        //    System.out.println(N+" "+k+" "+rrr.size());
        //} else
        for (int i = 0; i < res.length; i++) {
            ArrayList arrayList = res[i];
            if (arrayList.size() != 0) {
                System.out.println();
                System.out.print(arrayList.size() + " ");
            }
            for (Object object : arrayList) {
                System.out.print((Integer) object + " ");
            }
        }

    }

    public static boolean find(int a, int[][] mas, ArrayList rr, int ind) {
        boolean res = false;
        for (int j = ind + 1; j < mas.length; j++) {
            int[] is = mas[j];
            if (is[a] != 0) {
                boolean promej = true;
                for (Object i : rr) {
                    Integer ii = (Integer) i;
                    if (is[ii] == 0) {
                        promej = false;
                    } else {
                    }
                }
                if (promej) {
                    res = true;
                    is[a] = -1;
                }
            }

        }
        return res;
    }

    public static ArrayList createSet(int index, int[][] mas) {
        ArrayList res = new ArrayList<Integer>(250);
        for (int i = 1; i <= 200; i++) {
            if (mas[index][i] != 0) {
                int dig = i;
                boolean find = find(dig, mas, res, index);
                if (find) {
                    res.add(dig);
                    mas[index][dig] = -1;
                }
            }
        }
        for (int[] m : mas) {
            for (Object i : res) {
                int ii = (Integer) i;
                m[ii] = 0;
            }
        }
        return res;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

/**
 *
 * @author dima
 */
public class Main {

    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok;

    public static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            String rl = in.readLine();
            if (rl == null) {
                return null;
            }
            tok = new StringTokenizer(rl);
        }
        return tok.nextToken();
    }

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

    public static void main(String[] args) throws IOException {

        int n = 0, N;
        n = nextInt();
        N = n * (n - 1) / 2;
        int[][] inMas = new int[N + 10][250];
        ArrayList[] res = new ArrayList[N + 4500];

        for (int i = 0; i < N; i++) {
            int k = nextInt();

            for (int j = 0; j < k; j++) {
                int inInt = nextInt();
                inMas[i][inInt] = 1;
            }
        }
        int k = 0;
        ArrayList rrr = null;

        for (int i = 0; i < N; i++) {
            res[k++] = createSet(i, inMas);
            rrr = new ArrayList(2500);
            for (int j = 1; j <= 200; j++) {
                if (inMas[i][j] == 1) {
                    rrr.add(j);
                }
            }
            if (rrr.size() != 0) {
                res[k++] = rrr;
            }

            for (int[] m : inMas) {
                for (Object is : rrr) {
                    int ii = (Integer) is;
                    m[ii] = 0;
                }
            }
        }
        //if(n==10){
        //    System.out.println(N+" "+k+" "+rrr.size());
        //} else
        for (int i = 0; i < res.length; i++) {
            ArrayList arrayList = res[i];
            if (arrayList != null && arrayList.size() != 0) {
                System.out.println();
                System.out.print(arrayList.size() + " ");
            }
            if (arrayList != null && arrayList.size() != 0) {
                for (Object object : arrayList) {
                    System.out.print((Integer) object + " ");
                }
            }
        }

    }

    public static boolean find(int a, int[][] mas, ArrayList rr, int ind) {
        boolean res = false;
        for (int j = ind + 1; j < mas.length; j++) {
            int[] is = mas[j];
            if (is[a] != 0) {
                boolean promej = true;
                for (Object i : rr) {
                    Integer ii = (Integer) i;
                    if (is[ii] == 0) {
                        promej = false;
                    } else {
                    }
                }
                if (promej) {
                    res = true;
                    is[a] = -1;
                }
            }

        }
        return res;
    }

    public static ArrayList createSet(int index, int[][] mas) {
        ArrayList res = new ArrayList<Integer>(250);
        for (int i = 1; i <= 200; i++) {
            if (mas[index][i] != 0) {
                int dig = i;
                boolean find = find(dig, mas, res, index);
                if (find) {
                    res.add(dig);
                    mas[index][dig] = -1;
                }
            }
        }
        for (int[] m : mas) {
            for (Object i : res) {
                int ii = (Integer) i;
                m[ii] = 0;
            }
        }
        if (res.size() != 0) {
            return res;
        } else {
            return  null;
        }
    }
}


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

public class Main implements Runnable {

	final static int N = 202;

	public void _main() throws IOException {
		int n = nextInt();
		boolean[][] occurs = new boolean[N][n * (n - 1) / 2];
		boolean[] any = new boolean[N];
		for (int i = 0; i < n * (n - 1) / 2; i++) {
			int k = nextInt();
			for (int j = 0; j < k; j++) {
				int x = nextInt();
				occurs[x][i] = true;
				any[x] = true;
			}
		}
		if (n == 2) {
			List<Integer> all = new ArrayList<Integer>();
			for (int i = 0; i < N; i++)
				if (any[i])
					all.add(i);
			out.println("1 " + all.get(all.size() - 1));
			all.remove(all.size() - 1);
			out.print(all.size());
			for (int x : all)
				out.print(" " + x);
			out.println();
			return;
		}
		boolean[][] inSameSet = new boolean[N][N];
		for (int i = 0; i < N; i++)
			for (int j = 0; j < N; j++) {
				boolean ok = true;
				for (int z = 0; z < n * (n - 1) / 2; z++)
					if (occurs[i][z] ^ occurs[j][z]) {
						ok = false;
						break;
					}
				inSameSet[i][j] = ok;
			}
		boolean[] was = new boolean[N];
		for (int i = 0; i < N; i++) {
			if (!any[i] || was[i]) continue;
			int[] q = new int[N];
			int qt = 0, qh = 1;
			q[0] = i;
			was[i] = true;
			while (qt < qh) {
				int x = q[qt++];
				for (int j = 0; j < N; j++)
					if (inSameSet[x][j] && !was[j]) {
						was[j] = true;
						q[qh++] = j;
					}
			}
			out.print(qh);
			for (int j = 0; j < qh; j++)
				out.print(" " + q[j]);
			out.println();
		}
	}

	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer st;

	private String next() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String rl = in.readLine();
			if (rl == null)
				return null;
			st = new StringTokenizer(rl);
		}
		return st.nextToken();
	}

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

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

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

	public static void main(String[] args) {
		Locale.setDefault(Locale.UK);
		new Thread(new Main()).start();
	}

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

			_main();

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

}


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

public class Main implements Runnable {

	final static int N = 202;

	public void _main() throws IOException {
		int n = nextInt();
		boolean[][] occurs = new boolean[N][n * (n - 1) / 2];
		boolean[] any = new boolean[N];
		for (int i = 0; i < n * (n - 1) / 2; i++) {
			int k = nextInt();
			for (int j = 0; j < k; j++) {
				int x = nextInt();
				occurs[x][i] = true;
				any[x] = true;
			}
		}
		boolean[][] inSameSet = new boolean[N][N];
		for (int i = 0; i < N; i++)
			for (int j = 0; j < N; j++) {
				boolean ok = true;
				for (int z = 0; z < n * (n - 1) / 2; z++)
					if (occurs[i][z] ^ occurs[j][z]) {
						ok = false;
						break;
					}
				inSameSet[i][j] = ok;
			}
		boolean[] was = new boolean[N];
		for (int i = 0; i < N; i++) {
			if (!any[i] || was[i]) continue;
			int[] q = new int[N];
			int qt = 0, qh = 1;
			q[0] = i;
			was[i] = true;
			while (qt < qh) {
				int x = q[qt++];
				for (int j = 0; j < N; j++)
					if (inSameSet[x][j] && !was[j]) {
						was[j] = true;
						q[qh++] = j;
					}
			}
			out.print(qh);
			for (int j = 0; j < qh; j++)
				out.print(" " + q[j]);
			out.println();
		}
	}

	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer st;

	private String next() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String rl = in.readLine();
			if (rl == null)
				return null;
			st = new StringTokenizer(rl);
		}
		return st.nextToken();
	}

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

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

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

	public static void main(String[] args) {
		Locale.setDefault(Locale.UK);
		new Thread(new Main()).start();
	}

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

			_main();

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

}


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

public class Solution {

    StreamTokenizer in;
    PrintWriter out;

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

    public void run() throws Exception {
        //in = new BufferedReader(new InputStreamReader(System.in));
        in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solve();
        out.flush();
    }

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

    public void solve() throws Exception {
        int n=nextInt();
        LinkedList a [] = new LinkedList [210];
        int y[] = new int [210];
        for (int i=0;i<210;i++)
            a[i] =new LinkedList <Integer> ();
        boolean [] b = new boolean [210];
        for (int i=0; i<n*(n-1)/2;i++)
        {
            int k=nextInt();
            LinkedList <Integer> l = new LinkedList <Integer>();
            for (int j=0; j<k;j++)
            {
                int s = nextInt();
                b[s]=true;
                l.add(s);
                y[s]++;
            }
            for (int j=0; j<k;j++)
            {
                for (int q=0;q<k;q++)
                {
                    if (q!=j&&!a[l.get(j)].contains(l.get(q))&&y[l.get(q)]==1&&y[l.get(j)]==1)
                        a[l.get(j)].add(l.get(q));
                }
            }
            for (int j=0; j<k;j++)
            {
                for (int q=0; q<a[l.get(j)].size();q++)
                    if (!l.contains(a[l.get(j)].get(q))&&a[l.get(j)].get(q)!=l.get(j))
                    {
                        a[l.get(j)].remove(a[l.get(j)].get(q));
                        q--;
                    }
            }
        }
        if (n==2)
        {
            for (int j=0; j<210;j++)
            {
                if (a[j].size()!=0)
                {
                    out.println("1 "+j);
                for (int i=0; i<a[j].size();i++)
                out.println("1 "+a[j].get(i));
                break;
                }
            }
        }
        else
        for (int i=0; i<210;i++)
        {
            if (a[i].size()==0&&b[i])
                {
                out.println("1 "+i);
                b[i]=false;
                }
            else
            {
                if (b[i])
                {
                out.print((a[i].size()+1)+" "+(i)+" ");
                b[i]=false;
                for (int j=0; j<a[i].size();j++)
                {
                //  if (b[j])
                out.print(a[i].get(j)+" ");
                b[(Integer) a[i].get(j)]=false;
                }
                out.println();
                }
            }
        }
    }

}


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

public class Solution {

    StreamTokenizer in;
    PrintWriter out;

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

    public void run() throws Exception {
        //in = new BufferedReader(new InputStreamReader(System.in));
        in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solve();
        out.flush();
    }

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

    public void solve() throws Exception {
        int n=nextInt();
        LinkedList a [] = new LinkedList [210];
        int y[] = new int [210];
        for (int i=0;i<210;i++)
            a[i] =new LinkedList <Integer> ();
        boolean [] b = new boolean [210];
        for (int i=0; i<n*(n-1)/2;i++)
        {
            int k=nextInt();
            LinkedList <Integer> l = new LinkedList <Integer>();
            for (int j=0; j<k;j++)
            {
                int s = nextInt();
                b[s]=true;
                l.add(s);
                y[s]++;
            }
            for (int j=0; j<k;j++)
            {
                for (int q=0;q<k;q++)
                {
                    if (q!=j&&!a[l.get(j)].contains(l.get(q))&&y[l.get(q)]==1&&y[l.get(j)]==1)
                        a[l.get(j)].add(l.get(q));
                }
            }
            for (int j=0; j<k;j++)
            {
                for (int q=0; q<a[l.get(j)].size();q++)
                    if (!l.contains(a[l.get(j)].get(q))&&a[l.get(j)].get(q)!=l.get(j))
                    {
                        a[l.get(j)].remove(a[l.get(j)].get(q));
                        q--;
                    }
            }
        }
        if (n==2)
        {
            for (int i=0; i<a[0].size();i++)
                out.println("1 "+a[0].get(i));
        }
        else
        for (int i=0; i<210;i++)
        {
            if (a[i].size()==0&&b[i])
                {
                out.println("1 "+i);
                b[i]=false;
                }
            else
            {
                if (b[i])
                {
                out.print((a[i].size()+1)+" "+(i)+" ");
                b[i]=false;
                for (int j=0; j<a[i].size();j++)
                {
                //  if (b[j])
                out.print(a[i].get(j)+" ");
                b[(Integer) a[i].get(j)]=false;
                }
                out.println();
                }
            }
        }
    }

}