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;
const long long MOD = 1000 * 1000 * 1000 + 7;
const long long INF = INT_MAX;
const long long MOD2 = 998244353;
const long long N = 1000 * 100 + 10;
const long long N2 = 70;
const long double PI = 3.141592653589793;
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long power(long long x, long long y, long long p = LLONG_MAX) {
  long long res = 1;
  x %= p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
std::vector<int> g[N];
int k, n, m;
vector<int> d, p;
void dijkstra(int s) {
  d.assign(n, INF);
  p.assign(n, -1);
  d[s] = 0;
  set<pair<int, int>> q;
  q.insert({0, s});
  while (!q.empty()) {
    int v = q.begin()->second;
    q.erase(q.begin());
    for (auto edge : g[v]) {
      if (edge == INF) continue;
      int to = edge;
      int len = 1;
      if (d[v] + len < d[to]) {
        q.erase({d[to], to});
        d[to] = d[v] + len;
        p[to] = v;
        q.insert({d[to], to});
      }
    }
  }
}
vector<int> restore_path(int s, int t) {
  vector<int> path;
  for (int v = t; v != s; v = p[v]) path.push_back(v);
  path.push_back(s);
  return path;
}
bool check() {
  int ans = INT_MAX;
  pair<long long, long long> store;
  vector<int> dist(n, (int)(1e9));
  vector<int> par(n, -1);
  dist[0] = 0;
  queue<int> q;
  q.push(0);
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    for (int child : g[x]) {
      if (dist[child] == (int)(1e9)) {
        dist[child] = 1 + dist[x];
        par[child] = x;
        q.push(child);
      } else if (par[x] != child and par[child] != x) {
        store = {x, child};
        ans = min(ans, dist[x] + dist[child] + 1);
      }
    }
  }
  if (ans == INT_MAX)
    return false;
  else {
    for (auto &x : g[store.first]) {
      if (x == store.second) x = INF;
    }
    for (auto &x : g[store.second]) {
      if (x == store.first) x = INF;
    }
    dijkstra(store.first);
    vector<int> ans1 = restore_path(store.first, store.second);
    if (ans1.size() > k) {
      int req = k % 2 + k / 2;
      cout << 1 << "\n";
      for (int i = 0; i < ans1.size(); ++i) {
        if (i % 2) continue;
        cout << ans1[i] + 1 << " ";
        req--;
        if (!req) break;
      }
      cout << "\n";
    } else {
      cout << 2 << "\n";
      cout << ans1.size() << "\n";
      for (auto x : ans1) cout << x + 1 << " ";
    }
    return true;
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  if (!check()) {
    int vis[N];
    vector<int> dum[2];
    int level[N];
    memset(vis, 0, sizeof(vis));
    queue<int> q;
    q.push(0);
    level[0] = 0;
    vis[0] = true;
    while (!q.empty()) {
      int t = q.front();
      q.pop();
      for (auto x : g[t]) {
        if (!vis[x]) {
          q.push(x);
          level[x] = level[t] + 1;
          vis[x] = true;
        }
      }
    }
    for (int i = 0; i < n; ++i) {
      dum[level[i] % 2].push_back(i);
    }
    int req = k / 2 + k % 2;
    if (dum[0].size() >= req) {
      cout << 1 << "\n";
      for (int i = 0; i < req; ++i) {
        cout << dum[0][i] + 1 << " ";
      }
    } else {
      cout << 1 << "\n";
      for (int i = 0; i < req; ++i) {
        cout << dum[1][i] + 1 << " ";
      }
    }
  }
  cerr << "Time : " << 1000 * (long double)clock() / (long double)CLOCKS_PER_SEC
       << "ms\n";
  ;
  return 0;
}