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;
using namespace std::chrono;
template <typename A>
ostream &operator<<(ostream &cout, vector<A> const &v);
template <typename A, typename B>
ostream &operator<<(ostream &cout, pair<A, B> const &p) {
  return cout << "(" << p.first << ", " << p.second << ")";
}
template <typename A>
ostream &operator<<(ostream &cout, vector<A> const &v) {
  cout << "[";
  for (int i = 0; i < v.size(); i++) {
    if (i) cout << ", ";
    cout << v[i];
  }
  return cout << "]";
}
template <typename A, typename B>
istream &operator>>(istream &cin, pair<A, B> &p) {
  cin >> p.first;
  return cin >> p.second;
}
mt19937 rng(steady_clock::now().time_since_epoch().count());
void usaco(string filename) {
  freopen((filename + ".in").c_str(), "r", stdin);
  freopen((filename + ".out").c_str(), "w", stdout);
}
const long double pi = 3.14159265358979323846;
const long long mod = 1000000007;
long long n, m, k, q, Q, T, l, r, x, y, z;
long long a[1000005];
long long b[1000005];
long long c[1000005];
string second, t;
long long ans = 0;
long long sq;
set<pair<int, int> > degs;
vector<int> edges[200005];
long long deg[100005];
bool vis[100005];
bool anc[100005];
long long dep[100005];
int targ = -1;
vector<int> nseq;
void dfs(int v, int p, int d) {
  if (vis[v]) {
    if (anc[v] && dep[p] - dep[v] + 1 >= sq) {
      targ = v;
    }
    return;
  }
  dep[v] = d;
  vis[v] = 1;
  anc[v] = 1;
  for (int x : edges[v]) {
    dfs(x, v, d + 1);
    if (targ != -1) {
      nseq.push_back(v + 1);
      if (v == targ) {
        cout << 2 << endl;
        cout << nseq.size() << endl;
        {
          for (int ele = 0; ele < nseq.size(); ele++) {
            if (ele) cout << " ";
            cout << nseq[ele];
          }
          cout << '\n';
        };
        exit(0);
      }
      return;
    }
  }
  anc[v] = 0;
}
int main() {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
  };
  cin >> n >> m;
  sq = ceil(sqrt(n)) + 1e-7;
  for (long long i = 0; i < (m); i++) {
    cin >> x >> y;
    --x;
    --y;
    edges[x].push_back(y);
    edges[y].push_back(x);
    ++deg[x];
    ++deg[y];
  }
  bool t1 = 1;
  if (t1) {
    for (long long i = 0; i < (n); i++) degs.insert(make_pair(deg[i], i));
    vector<int> qset;
    memset(vis, 0, sizeof(vis));
    while (degs.size()) {
      pair<int, int> v = *degs.begin();
      degs.erase(degs.begin());
      if (!vis[v.second]) {
        qset.push_back(v.second + 1);
        vis[v.second] = 1;
        for (int x : edges[v.second]) {
          if (!vis[x]) {
            vis[x] = 1;
            for (int y : edges[x]) {
              if (!vis[y]) {
                degs.erase(make_pair(deg[y], y));
                --deg[y];
                degs.insert(make_pair(deg[y], y));
              }
            }
          }
        }
      }
    }
    if (qset.size() >= sq) {
      cout << 1 << endl;
      {
        for (int ele = 0; ele < sq; ele++) {
          if (ele) cout << " ";
          cout << qset[ele];
        }
        cout << '\n';
      };
      exit(0);
    }
    if (n <= 16) {
      for (long long i = 0; i < ((1 << n)); i++) {
        bool v[n];
        memset(v, 0, sizeof(v));
        bool first = 1;
        for (long long j = 0; j < (n); j++) {
          if (i & (1 << j)) {
            if (v[j]) {
              first = 0;
              break;
            } else {
              v[j] = 1;
              for (int x : edges[j]) v[x] = 1;
            }
          }
        }
        int c = __builtin_popcount(i);
        if (first && c >= sq) {
          cout << 1 << endl;
          for (long long j = 0; j < (n); j++)
            if (c > 0 && (i & (1 << j))) {
              cout << j + 1 << " ";
              --c;
            }
          cout << endl;
          exit(0);
        }
      }
    }
  }
  iota(a, a + n, 0);
  for (long long i = 0; i < (n); i++) {
    int j = (rng() % (n - i)) + i;
    swap(a[i], a[j]);
  }
  for (long long i = 0; i < (n); i++) {
    for (long long j = 0; j < (n); j++) dep[j] = mod;
    memset(vis, 0, sizeof(vis));
    int v = a[i];
    dfs(v, -1, 0);
  }
}