You've got a undirected graph G, consisting of n nodes. We will consider the nodes of the graph indexed by integers from 1 to n. We know that each node of graph G is connected by edges with at least k other nodes of this graph. Your task is to find in the given graph a simple cycle of length of at least k + 1.

A simple cycle of length d (d > 1) in graph G is a sequence of distinct graph nodes v1, v2, ..., vd such, that nodes v1 and vd are connected by an edge of the graph, also for any integer i (1 ≤ i < d) nodes vi and vi + 1 are connected by an edge of the graph.

Input

The first line contains three integers n, m, k (3 ≤ n, m ≤ 105; 2 ≤ k ≤ n - 1) — the number of the nodes of the graph, the number of the graph's edges and the lower limit on the degree of the graph node. Next m lines contain pairs of integers. The i-th line contains integers ai, bi (1 ≤ ai, bi ≤ n; ai ≠ bi) — the indexes of the graph nodes that are connected by the i-th edge. 

It is guaranteed that the given graph doesn't contain any multiple edges or self-loops. It is guaranteed that each node of the graph is connected by the edges with at least k other nodes of the graph.

Output

In the first line print integer r (r ≥ k + 1) — the length of the found cycle. In the next line print r distinct integers v1, v2, ..., vr (1 ≤ vi ≤ n) — the found simple cycle.

It is guaranteed that the answer exists. If there are multiple correct answers, you are allowed to print any of them.

Examples

Input

3 3 2
1 2
2 3
3 1


Output

3
1 2 3 

Input

4 6 3
4 3
1 2
1 3
1 4
2 3
2 4


Output

4
3 4 1 2 
import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Template implements Runnable {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Exception e) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
    }

    class GraphBuilder {
        int n, m;
        int[] x, y;
        int index;
        int[] size;


        GraphBuilder(int n, int m) {
            this.n = n;
            this.m = m;
            x = new int[m];
            y = new int[m];
            size = new int[n];
        }

        void add(int u, int v) {
            x[index] = u;
            y[index] = v;
            size[u]++;
            size[v]++;
            index++;
        }

        int[][] build() {
            int[][] graph = new int[n][];
            for (int i = 0; i < n; i++) {
                graph[i] = new int[size[i]];
            }
            for (int i = index - 1; i >= 0; i--) {
                int u = x[i];
                int v = y[i];
                graph[u][--size[u]] = v;
                graph[v][--size[v]] = u;
            }
            return graph;
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    int[] readIntArray(int size) throws IOException {
        int[] res = new int[size];
        for (int i = 0; i < size; i++) {
            res[i] = readInt();
        }
        return res;
    }

    long[] readLongArray(int size) throws IOException {
        long[] res = new long[size];
        for (int i = 0; i < size; i++) {
            res[i] = readLong();
        }
        return res;
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    <T> List<T>[] createGraphList(int size) {
        List<T>[] list = new List[size];
        for (int i = 0; i < size; i++) {
            list[i] = new ArrayList<>();
        }
        return list;
    }

    public static void main(String[] args) {
        new Template().run();
        // new Thread(null, new Template(), "", 1l * 200 * 1024 * 1024).start();
    }

    long timeBegin, timeEnd;

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    long memoryTotal, memoryFree;

    void memory() {
        memoryFree = Runtime.getRuntime().freeMemory();
        System.err.println("Memory = " + ((memoryTotal - memoryFree) >> 10)
                + " KB");
    }

    public void run() {
        try {
            timeBegin = System.currentTimeMillis();
            memoryTotal = Runtime.getRuntime().freeMemory();
            init();
            solve();
            out.close();
            if (System.getProperty("ONLINE_JUDGE") == null) {
                time();
                memory();
            }
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    int LEVELS = 19;
    int[][] p;
    int[] h;

    int[][] g;
    boolean[] used;

    void dfs(int x, int parent, int height) {
        h[x] = height;
        p[0][x] = parent;
        used[x] = true;
        for (int i = 1; i < LEVELS; i++) {
            p[i][x] = p[i - 1][p[i - 1][x]];
        }
        for (int y : g[x]) {
            if (!used[y]) {
                dfs(y, x, height + 1);
            } else {
                int d = dist(x, y);
                if (d > best) {
                    best = d;
                    bestA = x;
                    bestB = y;
                }
            }
        }
    }

    int best = -1;
    int bestA, bestB;

    int dist(int x, int y) {
        return h[x] + h[y] - 2 * h[lca(x, y)];
    }

    int lca(int x, int y) {
        if (h[x] < h[y]) {
            return lca(y, x);
        }

        for (int lvl = LEVELS - 1; lvl >= 0; lvl--) {
            int len = 1 << lvl;
            if (h[x] - h[y] >= len) {
                x = p[lvl][x];
            }
        }
        if (x == y) return x;

        for (int lvl = LEVELS - 1; lvl >= 0; lvl--) {
            if (p[lvl][x] != p[lvl][y]) {
                x = p[lvl][x];
                y = p[lvl][y];
            }
        }
        return p[0][x];
    }

    void solve() throws IOException {
        int n = readInt();
        int m = readInt();
        int k = readInt();
        h = new int[n];
        used = new boolean[n];
        p = new int[LEVELS][n];
        GraphBuilder gb = new GraphBuilder(n, m);
        for (int i = 0; i < m; i++) {
            gb.add(readInt() - 1, readInt() - 1);
        }
        g = gb.build();
        dfs(0, 0, 0);
        if (h[bestA] < h[bestB]) {
            int t = bestA;
            bestA = bestB;
            bestB = t;
        }

        ArrayDeque<Integer> left = new ArrayDeque<>();
        ArrayDeque<Integer> right = new ArrayDeque<>();
        left.add(bestA);
        right.add(bestB);

        while (h[bestA] != h[bestB]) {
            bestA = p[0][bestA];
            left.add(bestA);
        }

        while (bestA != bestB) {
            left.add(bestA);
            right.add(bestB);
            bestA = p[0][bestA];
            bestB = p[0][bestB];
        }

        right.pollLast();
        while (right.size() > 0) {
            left.add(right.pollLast());
        }
        out.println(left.size());
        for (int x : left) {
            out.print((x + 1) + " ");
        }
    }


}