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 
#include <bits/stdc++.h>
using namespace std;
const int sz = 2e5 + 5;
long long int arr[sz] = {0}, arr1[sz] = {0}, arr2[sz] = {0};
pair<int, int> arrp[2005][2005];
char arrc[2005][2005];
int arrtd[205][205] = {0};
bool visited[2005][2005], visited1[100005], visited2[100005];
int prime[10005] = {0};
vector<long long int> vec, vec1, vec2;
vector<pair<long long int, long long int>> vecp[1000], vecp1;
set<long long int> st, st1, st2;
vector<long long int> edges[100005], cost[50000];
long long int len[50000];
long long int level[1000][1000];
map<long long int, pair<long long int, long long int>> mpp;
long long int p = 0, cnt = 1, k;
bool ar = true;
void dfs(int n) {
  if (ar == false) return;
  visited1[n] = true;
  for (auto nxt : edges[n]) {
    if (st.count(nxt)) {
      arr[nxt]++;
    }
    if (arr[nxt] >= 2 && ar == true) {
      if ((cnt - arr1[nxt]) + 1 >= k + 1) {
        ar = false;
        p = nxt;
      }
    }
    if (!visited1[nxt]) {
      if (ar == true) {
        cnt++;
        arr1[nxt] = cnt;
        vec.push_back(nxt);
        st.insert(nxt);
        dfs(nxt);
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int n, m;
  cin >> n >> m >> k;
  int l = 0;
  memset(visited, false, sizeof(visited));
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    edges[a].push_back(b);
    edges[b].push_back(a);
    vec2.push_back(a);
    vec2.push_back(b);
  }
  int t = 0;
  for (auto i : vec2) {
    if (!visited2[i])
      visited2[i] = true;
    else
      continue;
    memset(visited1, false, sizeof(visited1));
    memset(arr, 0, sizeof(arr));
    memset(arr1, 0, sizeof(arr1));
    st.clear();
    vec.clear();
    ar = true;
    cnt = 0;
    bool af = true;
    vec.push_back(i);
    arr1[i] = cnt;
    p = i;
    st.insert(i);
    dfs(i);
    if (p != i) {
      for (auto nxt = vec.begin(); nxt != vec.end(); nxt++) {
        if (*nxt != p) {
          vec.erase(nxt);
          nxt--;
        } else
          break;
      }
    }
    auto it = vec.begin();
    auto it1 = vec.end();
    sort(edges[*it].begin(), edges[*it].end());
    it1--;
    if (!binary_search(edges[*it].begin(), edges[*it].end(), *it1)) {
      af = false;
    }
    if (af == true) break;
  }
  cout << vec.size() << "\n";
  for (auto it : vec) cout << it << " ";
}
