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.util.*;
import java.io.*;
import java.math.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
public class Main {
  static ArrayList<Integer> a[] = new ArrayList[150005];
  static int []vis = new int[150005];
  static ArrayList<Integer> ans;


  static void GO(int n, Stack<Integer> s)
  {
    vis[n] = 1;
    int find = 0;
    for (int j = 0;j < a[n].size();++j) {
      if (vis[a[n].get(j)] == 0) {
        s.push(a[n].get(j));
        GO(a[n].get(j), s);
        s.pop();
        find = 1;
      }
    }
    if (find == 0 && ans.size() == 0) {
      ArrayList<Integer> path = new ArrayList<>(s);
      Set<Integer> st = new HashSet<>();
      int v = path.get(path.size() - 1);
      for (int i = 0;i < a[v].size();++i) {
        st.add(a[v].get(i));
      }
      for (int i = 0;i < path.size();++i) {
        if (st.contains(path.get(i))) {
          for (int j = i;j < path.size();++j) {
            ans.add(path.get(j));
          }
          return;
        }
      }
    }
  }

  
  public static void main(String[] args) {
    try {
      MScanner in = new MScanner(System.in);
      BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out, "UTF-8"));

      int n = in.nextInt();
      int m = in.nextInt();
      int k = in.nextInt();
      
      for (int i = 0;i <= n;++i) {
        a[i] = new ArrayList<>();
      }
      ans = new ArrayList<Integer>();
      for (int i = 0;i < m;++i) {
        int i1 = in.nextInt();
        int i2 = in.nextInt();
        a[i1].add(i2);
        a[i2].add(i1);
      }
      
      for (int i = 0;i < n;++i) {
        if (vis[i] == 1) continue;
        Stack<Integer> s = new Stack<>();
        s.push(i);
        GO(i, s);
      }
      System.out.print((ans.size()) + "\n");
      for (int j = 0;j < ans.size();++j) {
        System.out.print(ans.get(j) + " ");
      }
      //out.write("\n");
      System.out.println();

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  static class MScanner {
    StringTokenizer st;
    BufferedReader br;
    public MScanner(InputStream system) {
      br = new BufferedReader(new InputStreamReader(system));
    }

    public MScanner(String file) throws Exception {
      br = new BufferedReader(new FileReader(file));
    }

    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens())
        st = new StringTokenizer(br.readLine());
      return st.nextToken();
    }
    public int[] takearr(int n) throws IOException {
      int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
      return in;
    }
    public long[] takearrl(int n) throws IOException {
      long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
      return in;
    }
    public Integer[] takearrobj(int n) throws IOException {
      Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
      return in;
    }
    public Long[] takearrlobj(int n) throws IOException {
      Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
      return in;
    }
    public String nextLine() throws IOException {
      return br.readLine();
    }

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

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

    public char nextChar() throws IOException {
      return next().charAt(0);
    }

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

    public boolean ready() throws IOException {
      return br.ready();
    }

    public void waitForInput() throws InterruptedException {
      Thread.sleep(3000);
    }
  }
}
