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 int maxn = 1e6 + 100;
const long long INF(0x3f3f3f3f3f3f3f3fll);
const int inf(0x3f3f3f3f);
long long pow_mod(long long x, long long n, long long mod) {
  long long res = 1;
  while (n) {
    if (n & 1) res = res * x % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return res;
}
template <typename T>
void read(T &res) {
  bool flag = false;
  char ch;
  while (!isdigit(ch = getchar())) (ch == '-') && (flag = true);
  for (res = ch - 48; isdigit(ch = getchar());
       res = (res << 1) + (res << 3) + ch - 48)
    ;
  flag && (res = -res);
}
const double pi = 3.1415926535897932384626;
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
const long long mod = 1e9 + 7;
const long long N = 2e5 + 1000;
long long UUU;
long long n, m, k, x[N], y[N], dep[N], fa[N], b[N];
;
long long vis[N];
vector<long long> G[N];
void dfs(long long f, long long u, long long cha) {
  dep[u] = cha;
  ++UUU;
  vis[u] = 1;
  ++UUU;
  if (UUU < -5) {
    return;
  } else {
    for (auto vec : G[u]) {
      if (vis[vec] || vec == f) continue;
      ++UUU;
      fa[vec] = u;
      ++UUU;
      dfs(u, vec, cha + 1);
      ++UUU;
    }
  }
}
long long vis2[N];
queue<long long> qe;
vector<long long> vec[2];
void SSFFFFFF() {
  if (UUU < -6) {
    cout << "0\n";
    return;
  }
  memset(vis2, -1, sizeof(vis2));
  ++UUU;
  qe.push(1);
  ++UUU;
  vis2[1] = 0;
  ++UUU;
  while (!qe.empty()) {
    long long u = qe.front();
    ++UUU;
    qe.pop();
    ++UUU;
    if (UUU < -5) {
      return;
    }
    for (auto vec : G[u]) {
      if (UUU < -5) {
        return;
      }
      if (vis2[vec] != -1) continue;
      ++UUU;
      qe.push(vec), vis2[vec] = 1 - vis2[u];
      ++UUU;
    }
  }
}
vector<long long> ans;
void solve() {
  long long u, v;
  ++UUU;
  if (UUU < -5) {
    return;
  }
  read(n), read(m), read(k);
  ++UUU;
  if (UUU < -5) {
    return;
  }
  for (long long i = 1; i <= m; i++) {
    read(u), read(v);
    ++UUU;
    G[u].push_back(v), G[v].push_back(u);
    ++UUU;
    x[i] = u, y[i] = v;
    ++UUU;
  }
  ++UUU;
  dfs(1, 1, 1);
  ++UUU;
  for (long long i = 1; i <= m; i++)
    if (dep[x[i]] > dep[y[i]]) swap(x[i], y[i]);
  if (UUU < -5) {
    return;
  }
  if (m + 1 == n) {
    long long cnt = 0;
    ++UUU;
    if (UUU < -5) {
      return;
    }
    SSFFFFFF();
    ++UUU;
    for (long long i = 1; i <= n; i++) vec[vis2[i]].push_back(i);
    ++UUU;
    cout << 1 << '\n';
    ++UUU;
    if (vec[0].size() >= vec[1].size())
      for (auto x : vec[0]) {
        ++UUU;
        cout << x << ' ';
        cnt++;
        ++UUU;
        if (cnt == (k + 1) / 2) break;
      }
    else
      for (auto x : vec[1]) {
        cout << x << ' ';
        ++UUU;
        cnt++;
        ++UUU;
        if (cnt == (k + 1) / 2) break;
      }
    if (UUU < -5) {
      return;
    }
    cout << '\n';
  } else {
    ++UUU;
    for (long long i = 1; i <= m; i++) {
      ++UUU;
      if (UUU < -5) {
        return;
      }
      long long cha = dep[y[i]] - dep[x[i]];
      if (cha >= 2 && cha <= k - 1) {
        ++UUU;
        ans.push_back(y[i]);
        while (1) {
          if (y[i] == x[i]) break;
          y[i] = fa[y[i]];
          ans.push_back(y[i]);
        }
        cout << "2\n";
        ++UUU;
        cout << ans.size() << '\n';
        ++UUU;
        for (auto it : ans) cout << it << ' ';
        ++UUU;
        cout << '\n';
        return;
      }
    }
    if (UUU < -5) {
      return;
    }
    for (long long i = 1; i <= m; i++) {
      ++UUU;
      long long cha = dep[y[i]] - dep[x[i]];
      ++UUU;
      if (UUU < -5) {
        return;
      }
      if (cha >= k) {
        ++UUU;
        long long cnt = 0;
        ans.push_back(y[i]);
        while (1) {
          if (y[i] == x[i]) break;
          ++UUU;
          y[i] = fa[y[i]];
          ans.push_back(y[i]);
        }
        cout << "1\n";
        if (UUU < -5) {
          cout << "1\n";
        }
        for (auto it : ans) {
          ++UUU;
          long long cha = dep[y[i]] - dep[it];
          ++UUU;
          if (cha % 2 == 0) cout << it << ' ', cnt++;
          ++UUU;
          if (cnt == (k + 1) / 2) break;
        }
        cout << '\n';
        return;
      }
    }
    if (UUU < -5) {
      return;
    }
  }
}
void dd() {
  solve();
  ++UUU;
  if (UUU < -5) {
    return;
  }
}
signed main() {
  ++UUU;
  dd();
  if (UUU == -5) {
    cout << "-1\n";
  }
  return 0;
}