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.util.*;

/*




*/


public class D {
	static FastReader sc=null;
	static ArrayList<Integer> adj[];
	static boolean visited[];
	static int from[];
	static int k;
	static Set<Integer> dist;
	static ArrayList<Integer> ans;
	static boolean found=false;
	static int entry[];
	static int start=-1;
	
	
	public static void main(String[] args) {
		sc=new FastReader();
		PrintWriter out=new PrintWriter(System.out);
		int n=sc.nextInt(),m=sc.nextInt();k=sc.nextInt();
		
		adj=new ArrayList[n];
		for(int i=0;i<n;i++)adj[i]=new ArrayList<>();
		for(int i=0;i<m;i++) {
			int v=sc.nextInt()-1,w=sc.nextInt()-1;
			adj[v].add(w);
			adj[w].add(v);
		}
		from=new int[n];
		visited=new boolean[n];
		dist=new HashSet<>();
		ans=new ArrayList<>();
		entry=new int[n];
		Arrays.fill(entry, -1);
		Arrays.fill(from, -1);
		
		//task is to ignore all the cycles smaller
		dfs0(0,-1,0);
		//System.out.println(Arrays.toString(entry)+" "+start);
		if(start==-1)throw null;
		//System.out.println(start);
		dfs(start,-1,0);
		if(!found)throw null;
		
		//System.out.println(Arrays.toString(from));
		ArrayList<Integer> fans=new ArrayList<>();
		Set<Integer> repeats=new HashSet<>();
		for(int e:ans) {
			if(!repeats.contains(e)) {
				fans.add(e);
				repeats.add(e);
			}
			else break;
		}
		ans=fans;
		//ans.add(1);
//		if(ans.size()==1) {
//			for(int e:adj[0]) {
//				System.out.println(e);
//			}
//			//System.out.println(repeats.toString());
//			//System.out.println(found);
//			throw null;
//		}
	    out.println(ans.size());
		for(int e:ans)out.print(e+" ");
		out.println();
		out.close();
		
		
		
	}
	static void dfs0(int v,int par,int time) {
		if(start!=-1)return;
		entry[v]=time;
		for(int e:adj[v]) {
			if(entry[e]==-1)dfs0(e,v,time+1);
			else {
				if(Math.abs(entry[e]-entry[v])>=k) {
					start=v;
					//System.out.println("CAME HERE "+start);
					return;
				}
			}
		}
	}
	static void dfs(int v,int par,int l) {
		if(found)return;
		dist.add(l);
		if(from[v]==-1)from[v]=par;
		visited[v]=true;
		for(int e:adj[v]) {
			if(e!=par) {
				if(e==start && l>=k) {
					//retrieve path here
					int curr=v;
					//System.out.println(curr);
					//System.out.println(Arrays.toString(from));
					while(curr!=-1) {
						ans.add(curr+1);
						curr=from[curr];
					}
					found=true;
					break;
				}
				else if(!visited[e]) {
					dfs(e,v,l+1);
				}
			}
		}
	}
	
	static int[] ruffleSort(int a[]) {
		ArrayList<Integer> al=new ArrayList<>();
		for(int i:a)al.add(i);
		Collections.sort(al);
		for(int i=0;i<a.length;i++)a[i]=al.get(i);
		return a;
	}
	
	static class FastReader{
		
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		
		String next() {
			while(!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				}
				catch(IOException e){
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		
		long nextLong() {
			return Long.parseLong(next());
		}
		
		int[] readArray(int n) {
			int a[]=new int[n];
			for(int i=0;i<n;i++)a[i]=sc.nextInt();
			return a;
		}
	}
}






