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;
typedef long long ll;
typedef int (*itoi)(int);
typedef int (*iitoi)(int, int);
typedef int (*iiitoi)(int, int, int);
typedef ll (*ltol)(ll);
typedef ll (*lltol)(ll, ll);
typedef ll (*llltol)(ll, ll, ll);
const long double PI = acos(0) * 2;
const int INF = 0x3f2f1f0f;
const ll LINF = 1ll * INF * INF;
int X4[] = {-1, 0, 1, 0}, Y4[] = {0, -1, 0, 1};
int X8[] = {-1, -1, -1, 0, 1, 1, 1, 0}, Y8[] = {-1, 0, 1, 1, 1, 0, -1, -1};
template <typename T>
inline bool uax(T& a, T b) {
  return a < b ? (a = b, 1) : 0;
}
template <typename T>
inline bool uin(T& a, T b) {
  return a > b ? (a = b, 1) : 0;
}
template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
  return is >> p.first >> p.second;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
  return os << '(' << p.first << ", " << p.second << ")";
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (int i = 0; i < (int)v.size(); i++) {
    os << v[i];
    if (i + 1 < (int)v.size()) os << ' ';
  }
  return os;
}
const int MAX_N = 1e5 + 20;
int N, Vst[MAX_N], Lv[MAX_N];
int SqN;
vector<int> Ed[MAX_N];
vector<int> Td[MAX_N];
int AnsType;
int T2A, T2B;
int Sel1[MAX_N], Bnn1[MAX_N];
void dfs_make_tree(int a, int p = 0) {
  if (p) {
    Td[p].push_back(a);
    Td[a].push_back(p);
  }
  Vst[a] = 1;
  Lv[a] = Lv[p] + 1;
  int mn = Lv[a], mnb = 0;
  for (auto& b : Ed[a]) {
    if (Vst[b]) {
      if (uin(mn, Lv[b])) {
        mnb = b;
      }
    } else
      dfs_make_tree(b, a);
  }
  if (Lv[a] - Lv[mnb] + 1 >= SqN) {
    AnsType = 2;
    T2A = mnb;
    T2B = a;
  }
}
bool make_path(int a, int dst, vector<int>& path) {
  path.push_back(a);
  if (a == dst) {
    return 1;
  }
  for (auto& b : Td[a]) {
    if (Lv[b] == Lv[a] + 1) {
      if (make_path(b, dst, path)) return 1;
    }
  }
  path.pop_back();
  return 0;
}
void dfs_make_ans1(int a, int p = 0) {
  for (auto& b : Td[a]) {
    if (b == p) continue;
    dfs_make_ans1(b, a);
  }
  if (!Bnn1[a]) {
    Sel1[a] = 1;
    for (auto& b : Ed[a]) {
      Bnn1[b] = 1;
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << std::setprecision(10);
  cout << fixed;
  int m;
  cin >> N >> m;
  SqN = sqrt(N);
  if (SqN * SqN < N) SqN++;
  for (int i = 0; i < (m); i++) {
    int a, b;
    cin >> a >> b;
    Ed[a].push_back(b);
    Ed[b].push_back(a);
  }
  dfs_make_tree(1);
  if (AnsType) {
    vector<int> path;
    make_path(T2A, T2B, path);
    cout << 2 << endl << ((int)(path).size()) << endl;
    for (auto& x : path) {
      cout << x << ' ';
    }
    cout << endl;
  } else {
    dfs_make_ans1(1);
    cout << 1 << endl;
    int cnt = 0;
    for (int a = 1; a <= N; a++) {
      if (Sel1[a]) cout << a << ' ', cnt++;
      if (cnt == SqN) break;
    }
    assert(cnt >= SqN);
    cout << endl;
  }
  return 0;
}