Problem: You are given an undirected graph with n vertices and m edges. Also, you are given an integer k.

Find either a clique of size k or a non-empty subset of vertices such that each vertex of this subset has at least k neighbors in the subset. If there are no such cliques and subsets report about it.

A subset of vertices is called a clique of size k if its size is k and there exists an edge between every two vertices from the subset. A vertex is called a neighbor of the other vertex if there exists an edge between them.

Input

The first line contains a single integer t (1 ≤ t ≤ 10^5) — the number of test cases. The next lines contain descriptions of test cases.

The first line of the description of each test case contains three integers n, m, k (1 ≤ n, m, k ≤ 10^5, k ≤ n).

Each of the next m lines contains two integers u, v (1 ≤ u, v ≤ n, u ≠ v), denoting an edge between vertices u and v.

It is guaranteed that there are no self-loops or multiple edges. It is guaranteed that the sum of n for all test cases and the sum of m for all test cases does not exceed 2 ⋅ 10^5.

Output

For each test case: 

If you found a subset of vertices such that each vertex of this subset has at least k neighbors in the subset in the first line output 1 and the size of the subset. On the second line output the vertices of the subset in any order.

If you found a clique of size k then in the first line output 2 and in the second line output the vertices of the clique in any order.

If there are no required subsets and cliques print -1.

If there exists multiple possible answers you can print any of them.

Example

Input


3
5 9 4
1 2
1 3
1 4
1 5
2 3
2 4
2 5
3 4
3 5
10 15 3
1 2
2 3
3 4
4 5
5 1
1 7
2 8
3 9
4 10
5 6
7 10
10 8
8 6
6 9
9 7
4 5 4
1 2
2 3
3 4
4 1
1 3


Output


2
4 1 2 3 
1 10
1 2 3 4 5 6 7 8 9 10 
-1

Note

In the first test case: the subset \{1, 2, 3, 4\} is a clique of size 4.

In the second test case: degree of each vertex in the original graph is at least 3. So the set of all vertices is a correct answer.

In the third test case: there are no cliques of size 4 or required subsets, so the answer is -1.

Solution (in JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Set;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int numTests = in.nextInt();
            for (int test = 0; test < numTests; test++) {
                int n = in.nextInt();
                int m = in.nextInt();
                int k = in.nextInt();
                Graph g = new Graph(n);
                int[] deg = new int[n];
                Set<Integer>[] edgesFrom = new Set[n];
                for (int i = 0; i < n; i++) {
                    edgesFrom[i] = new HashSet<>();
                }
                for (int i = 0; i < m; i++) {
                    int a = in.nextInt() - 1;
                    int b = in.nextInt() - 1;
                    if (a > b) {
                        int t = a;
                        a = b;
                        b = t;
                    }
                    g.addEdge(a, b);
                    g.addEdge(b, a);
                    ++deg[a];
                    ++deg[b];
                    edgesFrom[a].add(b);
                }
                if ((long) k * (k - 1) / 2 > m) {
                    out.println(-1);
                    continue;
                }
                int[] q = new int[n];
                int qt = 0;
                int qh = 0;
                int[] state = new int[n];
                for (int i = 0; i < n; i++) {
                    if (deg[i] < k) {
                        state[i] = 1;
                        q[qh++] = i;
                    }
                }
                int[] clique = null;
                int[] cand = new int[k];
                while (qt < qh) {
                    int v = q[qt++];
                    if (deg[v] == k - 1 && clique == null) {
                        int p = 0;
                        cand[p++] = v;
                        for (int e = g.firstEdge[v]; e >= 0; e = g.edgeNxt[e]) {
                            int u = g.edgeDst[e];
                            if (state[u] != 2) {
                                cand[p++] = u;
                            }
                        }
                        if (p != k) {
                            throw new AssertionError(p + " " + k);
                        }
                        boolean ok = true;
                        outer:
                        for (int i = 0; i < k; i++) {
                            for (int j = i + 1; j < k; j++) {
                                int x = Math.min(cand[i], cand[j]);
                                int y = Math.max(cand[i], cand[j]);
                                if (!edgesFrom[x].contains(y)) {
                                    ok = false;
                                    break outer;
                                }
                            }
                        }
                        if (ok) {
                            clique = cand.clone();
                        }
                    }
                    state[v] = 2;
                    for (int e = g.firstEdge[v]; e >= 0; e = g.edgeNxt[e]) {
                        int u = g.edgeDst[e];
                        --deg[u];
                        if (state[u] == 0 && deg[u] < k) {
                            state[u] = 1;
                            q[qh++] = u;
                        }
                    }
                }

                if (qt < n) {
                    List<Integer> ans = new ArrayList<>();
                    for (int i = 0; i < n; i++) {
                        if (state[i] == 0) {
                            ans.add(i);
                        }
                    }
                    out.println("1 " + ans.size());
                    for (int i = 0; i < ans.size(); i++) {
                        if (i > 0) {
                            out.print(" ");
                        }
                        out.print(ans.get(i) + 1);
                    }
                    out.println();
                    continue;
                }
                if (clique != null) {
                    out.println("2");
                    for (int i = 0; i < clique.length; i++) {
                        if (i > 0) {
                            out.print(" ");
                        }
                        out.print(clique[i] + 1);
                    }
                    out.println();
                    continue;
                }
                out.println(-1);
            }
        }

        class Graph {
            int n;
            int[] firstEdge;
            int[] edgeDst;
            int[] edgeNxt;
            int numEdges;

            Graph(int n) {
                this.n = n;
                firstEdge = new int[n];
                Arrays.fill(firstEdge, -1);
                final int initialCapacity = 2 * n - 2;
                edgeDst = new int[initialCapacity];
                edgeNxt = new int[initialCapacity];
                numEdges = 0;
            }

            void addEdge(int a, int b) {
                int e = numEdges++;
                if (e >= edgeDst.length) {
                    reallocate();
                }
                edgeDst[e] = b;
                edgeNxt[e] = firstEdge[a];
                firstEdge[a] = e;
            }

            private void reallocate() {
                int k = edgeDst.length;
                edgeDst = Arrays.copyOf(edgeDst, 3 * k / 2);
                edgeNxt = Arrays.copyOf(edgeNxt, 3 * k / 2);
            }

        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

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

    }
}