Problem: Given a connected undirected graph with n vertices and an integer k, you have to either:

  * either find an independent set that has exactly ⌈k/2⌉ vertices.
  * or find a simple cycle of length at most k. 



An independent set is a set of vertices such that no two of them are connected by an edge. A simple cycle is a cycle that doesn't contain any vertex twice. 

I have a proof that for any input you can always solve at least one of these problems, but it's left as an exercise for the reader.

Input

The first line contains three integers n, m, and k (3 ≤ k ≤ n ≤ 10^5, n-1 ≤ m ≤ 2 ⋅ 10^5) — the number of vertices and edges in the graph, and the parameter k from the statement.

Each of the next m lines contains two integers u and v (1 ≤ u,v ≤ n) that mean there's an edge between vertices u and v. It's guaranteed that the graph is connected and doesn't contain any self-loops or multiple edges.

Output

If you choose to solve the first problem, then on the first line print 1, followed by a line containing ⌈k/2⌉ distinct integers not exceeding n, the vertices in the desired independent set.

If you, however, choose to solve the second problem, then on the first line print 2, followed by a line containing one integer, c, representing the length of the found cycle, followed by a line containing c distinct integers not exceeding n, the vertices in the desired cycle, in the order they appear in the cycle.

Examples

Input


4 4 3
1 2
2 3
3 4
4 1


Output


1
1 3 

Input


4 5 3
1 2
2 3
3 4
4 1
2 4


Output


2
3
2 3 4 

Input


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


Output


2
3
1 2 3 

Input


5 4 5
1 2
1 3
2 4
2 5


Output


1
1 4 5 

Note

In the first sample:

<image>

Notice that printing the independent set \{2,4\} is also OK, but printing the cycle 1-2-3-4 isn't, because its length must be at most 3.

In the second sample:

<image>

Notice that printing the independent set \{1,3\} or printing the cycle 2-1-4 is also OK.

In the third sample:

<image>

In the fourth sample:

<image>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long long mull(long long a, long long b) {
  long long res = 0;
  a %= 1000000007;
  while (b) {
    if (b & 1) res = (res + a) % 1000000007;
    a = (2 * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long modInverse(long long n, long long p) { return power(n, p - 2, p); }
struct cmp {
  bool operator()(const pair<long long, long long> &a,
                  const pair<long long, long long> &b) const {
    long long lena = a.second - a.first + 1;
    long long lenb = b.second - b.first + 1;
    if (lena == lenb) return a.first < b.first;
    return lena > lenb;
  }
};
using namespace std;
vector<long long> t[100001];
vector<set<long long> > g(100001);
map<pair<long long, long long>, long long> m1;
long long depth[100001];
bool stat[100001];
long long parent[100001][20];
void dfs(long long cur, long long prev) {
  stat[cur] = true;
  depth[cur] = depth[prev] + 1;
  parent[cur][0] = prev;
  for (long long i = 0; i < t[cur].size(); i++) {
    if (t[cur][i] != prev && stat[t[cur][i]] == false) {
      dfs(t[cur][i], cur);
      m1[{min(t[cur][i], cur), max(t[cur][i], cur)}] = 1;
    }
  }
}
void precomputeSparseMatrix(long long n) {
  for (long long i = 1; i < 20; i++) {
    for (long long node = 1; node <= n; node++) {
      if (parent[node][i - 1] != -1)
        parent[node][i] = parent[parent[node][i - 1]][i - 1];
    }
  }
}
long long lca(long long u, long long v) {
  if (depth[v] < depth[u]) swap(u, v);
  long long diff = depth[v] - depth[u];
  for (long long i = 0; i < 20; i++)
    if ((diff >> i) & 1) v = parent[v][i];
  if (u == v) return u;
  for (long long i = 20 - 1; i >= 0; i--)
    if (parent[u][i] != parent[v][i]) {
      u = parent[u][i];
      v = parent[v][i];
    }
  return parent[u][0];
}
void addEdge(long long u, long long v) {
  t[u].push_back(v);
  t[v].push_back(u);
}
void dfs1(long long u) {
  stat[u] = true;
  for (auto it : g[u]) {
    if (stat[it] == false) {
      dfs1(it);
      addEdge(u, it);
    }
  }
}
void solve() {
  long long n, m, k;
  cin >> n >> m >> k;
  for (long long i = 0; i < m; i++) {
    long long u, v;
    cin >> u >> v;
    g[u].insert(v);
    g[v].insert(u);
  }
  memset(stat, false, sizeof(stat));
  vector<long long> head;
  for (long long i = 1; i < n + 1; i++) {
    if (stat[i] == false) {
      dfs1(i);
      head.push_back(i);
    }
  }
  long long up = k / 2;
  if (k % 2) up++;
  memset(stat, false, sizeof(stat));
  for (auto it : head) {
    dfs(it, 0);
  }
  bool fg = false;
  precomputeSparseMatrix(n);
  for (long long i = 1; i <= n; i++) {
    for (auto it : g[i]) {
      long long u = it, v = i;
      if (!m1[{min(u, v), max(u, v)}]) {
        m1[{min(u, v), max(u, v)}] = 1;
        long long l = lca(it, i);
        long long dis = depth[it] + depth[i] - 2 * depth[l];
        dis++;
        if (dis <= k) {
          cout << 2 << '\n';
          cout << dis << '\n';
          fg = true;
          vector<long long> path, path1;
          long long start = i;
          while (start != l) {
            path.push_back(start);
            start = parent[start][0];
          }
          path.push_back(l);
          start = it;
          while (start != l) {
            path1.push_back(start);
            start = parent[start][0];
          }
          reverse(path1.begin(), path1.end());
          for (auto itr : path) cout << itr << " ";
          for (auto itr : path1) cout << itr << " ";
          cout << '\n';
          break;
        }
      }
    }
    if (fg) break;
  }
  if (!fg) {
    set<pair<long long, long long> > s;
    long long cnt = 0;
    for (long long i = 1; i <= n; i++) {
      long long len = g[i].size();
      s.insert({len, i});
    }
    cout << 1 << '\n';
    while (1) {
      pair<long long, long long> tmp = *s.begin();
      cnt++;
      s.erase(s.begin());
      cout << tmp.second << " ";
      if (cnt == up) break;
      for (auto it : g[tmp.second]) {
        long long len = g[it].size();
        if (s.find({len, it}) != s.end()) {
          for (auto itr : g[it]) {
            long long ll = g[itr].size();
            if (g[itr].find(it) != g[itr].end()) {
              if (itr != tmp.second) g[itr].erase(g[itr].find(it));
            }
            if (s.find({ll, itr}) != s.end()) {
              pair<long long, long long> tt = *s.find({ll, itr});
              s.erase(s.find({ll, itr}));
              s.insert({tt.first - 1, tt.second});
            }
          }
          s.erase(s.find({len, it}));
        }
      }
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}