#include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;
int main()
{
	long long int i,j,k,l,m,n,t,sum;
	cin>>t;
	for(i=1;i<=t;i++)
	{
		sum=0;
		cin>>n;
		n=(n)/2;
		for(j=1;j<=n;j++)
		{
			sum=((2*j-1)*4+4)*j+sum;
		}
		cout<<sum<<endl;
	}
}


#include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;
int main()
{
	int  i,j,k,l,m,n,t,ans,p;
	cin>>t;
	for(i=1;i<=t;i++)
	{
		cin>>m;
		cin>>n;
		p=m;
		ans=0;
		for(j=1;j<=m;j++)
		{
			l=n/p;

			ans=ans+pow(l,2);
				n=n-l;
			p--;
	    }

		cout<<ans<<endl;
	}
}


#include<stdio.h>
int main(){
 int n;
 scanf("%d",&n);
 while(n--){
    int a,b;
    scanf("%d%d",&a,&b);
    if(a>=b)
        printf("1\n");
    else{
        int t=b%a;
        int f=b/a;
        f++;
        long long sum=0;
        for(int i=0;i<t;i++){
            sum+=f*f;
        }
       // if(t>0)
        f--;
        for(int i=0;i<a-t;i++){
            sum+=f*f;
        }
        printf("%lld\n",sum);
    }
 }
}


#include<stdio.h>
int main(){
 int n;
 scanf("%d",&n);
 while(n--){
    long long a,b;
    scanf("%lld%lld",&a,&b);
    if(a>=b)
        printf("%d\n",b);
    else{
        long long t=b%a;
        long long  f=b/a;
        f++;
        long long sum=0;
        for(int i=0;i<t;i++){
            sum+=f*f;
        }
        f--;
        for(int i=0;i<a-t;i++){
            sum+=f*f;
        }
        printf("%lld\n",sum);
    }
 }
}


#include<stdio.h>
int main(){
 int n;
 scanf("%d",&n);
 while(n--){
    int a,b;
    scanf("%d%d",&a,&b);
    if(a>=b)
        printf("1\n");
    else{
        int t=b%a;
        int f=b/a;
        long long sum=0;
        for(int i=0;i<t;i++){
            sum+=f*f;
        }
        if(t>0)
        f++;
        for(int i=0;i<a-t;i++){
            sum+=f*f;
        }
        printf("%lld\n",sum);
    }
 }
}


#include<stdio.h>
int main(){
 int n;
 scanf("%d",&n);
 while(n--){
    long long a,b;
    scanf("%lld%lld",&a,&b);
    if(a>=b)
        printf("1\n");
    else{
        long long t=b%a;
        long long  f=b/a;
        f++;
        long long sum=0;
        for(int i=0;i<t;i++){
            sum+=f*f;
        }
        f--;
        for(int i=0;i<a-t;i++){
            sum+=f*f;
        }
        printf("%lld\n",sum);
    }
 }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
  int t;
  cin >> t;
  while(t--)
  {
    long long a, b;
    cin >> a >> b;
    long long quoc = b / a, rest = b % a, ans = 0;

    for(int i = 0; i < rest; i++)
      ans += (quoc+1) * (quoc+1);
    for(int i = 0; i < a - rest; i++)
      ans += quoc * quoc;
    cout << ans << endl;
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define long long int lli

const int maxN = 1e9;

int main()
{
  int n;
  cin >> n;
  while(n--)
  {
    int c, sum;
    cin >> c >> sum;
    if(c == 0)
    {
      if(sum % 2 == 0)
      {
        cout << pow(sum/2, 2)*2 << endl;
      }
      else
      {
        cout << pow(sum/2, 2) + pow((sum/2)+1, 2) << endl;
      }
    }
    else
    {
      int v[sum];
      for(int i = 0; i < sum; i++)
      {
        sum[i] = i;
      }
      for(int j = 0; j < c; j++)
      {
        for(int i = 1; i < sum; i++)
        {
          sum +=
        }
      }
    }
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define long long int lli

const int maxN = 1e9;

int main()
{
  int n;
  cin >> n;
  while(n--)
  {
    int c, sum;
    cin >> c >> sum;
    if (sum == 1)
    {
      printf("%d\n", sum);
    }
    else if (sum % c == 0)
    {
      int r = sum / c ;
      int r2 = 0 ;

      for (int i = 0 ; i < c ; i++)
      {
        r2 = r2 + pow(r , 2);
      }

      printf("%d\n", r2);
    }
    else
    {
      int added = 0 ;

      while (1)
      {
        sum++ ;
        added++ ;
        if (sum % c == 0)
        {
          int r = sum / c ;
          int r2 = 0 ;

          for (int i = 0 ; i < r ; i++)
          {
            r2 = r2 + pow(r , 2);
          }

          r2 = r2 + added ;

          printf("%d\n", r2);

          break ;
        }
      }
    }
  }
  return 0;
}


#include<iostream>
using namespace std;

void isequal(){
int a,b;
cin >> a >> b;
int fault=abs((2*a)-b)%3;
if(fault==0)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
int main()
{
int t;
cin >> t;
while(t--)
{
isequal();
        }

    return 0;
}


#include<iostream>
using namespace std;

void isequal(){
int a,b;
cin >> a >> b;
int c=b/a;
int d=b%a;
int fault=d*(c+1)*(c+1)+(a-d)*c*c;
cout << fault << endl;
}
int main()
{
int t;
cin >> t;
while(t--)
{
 isequal();
}

    return 0;
}


#include<iostream>
using namespace std;

void isequal(){
int a,b;
cin >> a >> b;
int fault=abs((2*a)-b)%3;
if(a==0||b==0)
fault=1;
if(fault==0)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
int main()
{
int t;
cin >> t;
while(t--)
{
 isequal();
}

    return 0;
}


/************************************Tufaan************************************/
#include<bits/stdc++.h>
#define pi acos(-1.0)
#define pb push_back
#define LL long long
#define LIM 50000
#define dbg(x) cout<<#x<<" = "<<x<<'\n';
using namespace std;
int _I(){int x; scanf("%d",&x); return x;}
LL _L(){LL x; scanf("%lld",&x); return x;}
LL gcd(LL a, LL b){ while(b) b ^= a ^= b ^= a %= b; return a; }
LL lcm(LL x,LL y){x/=gcd(x,y); return x*y;}
int kdx[8]={-2,-2,-1,-1,1,1,2,2};
int kdy[8]={-1,1,-2,2,-2,2,-1,1};
bool prime[LIM+7];
long long _pow(long long a, long long b){
        if(b == 0) return 1;
        long long ret = 1;
        ret *= _pow(a, b/2);
        ret = ret*ret;
        if(b&1){
                ret *= a;
        }
        return ret;
}
bool inrng(LL x, LL y, LL c){
        return (x <= c && c <= y);
}
bool inRng(int a, int b, int x, int y){
        return ( inrng(a,b,x) || inrng(a,b,y) || inrng(x,y,a) || inrng(x,y,b) );
}
vector<int> v;
map<int, int> mp;
void sieve(){
    int i,j; prime[1]=1; v.pb(2);
    for(i=4;i<=LIM;i+=2) prime[i]=1;
    for(i=3;i<=LIM;i+=2) if(!prime[i]){ v.pb(i); for(j=i+i+i;j<=LIM;j+=i+i) prime[j]=1;}
}

/********************************************************************************/
/********************************************************************************/
int cases;
void fun(){
        long long i,j,c,x,sum,ans = 0;
        c = _L();
        sum = _L();
        if(sum <= c) {
                printf("%lld\n",sum); return;
        }
        while(sum%c){
                x = (sum/c) + 1;
                c--;
                sum -= x;
                ans += (x*x);
        }
        x = sum/c;
        ans += (c*x*x);
        printf("%lld\n",ans);
}

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    //sieve();
    int t = _I();
    while(t--)
    fun();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int _I(){ int x; scanf("%d",&x); return x; }
long long _L(){ long long x; scanf("%lld",&x); return x; }

void fun(){
        int i,j,k,ci,sumi;
        ci = _I();
        sumi = _I();
        if(ci >= sumi){
                printf("%d\n",sumi);return;
        }
        int x = __gcd(ci,sumi);
        int one = ci - x;
        int q = sumi - one;
        int v = q/x;
        long long ans = v*v*x;
        printf("%lld\n",ans+one);
}

int main(){
        int t = _I();
        while(t--)
                fun();
        return 0;
}


#include <iostream>
using namespace std;

int main() {
//	cout<<"GfG!";
int t;
cin>>t;
while(t--)
{
    int c,s,d,f,i,a=0;
    cin>>c>>s;
    if(c>=s)
    cout<<s*s<<"\n";
    else
    {
        d=s/c;
        f=s%c;
        for(i=1;i<=c;i++)
        {
            if(i<=f)
            a=a+(d+1)*(d+1);
            else
            a=a+d*d;
        }
        cout<<a<<"\n";
    }

}
	return 0;
}


#include <iostream>
using namespace std;

int main() {
//	cout<<"GfG!";
int t;
cin>>t;
while(t--)
{
    int c,s,d,f,i,a=0;
    cin>>c>>s;
    if(c>s)
    cout<<s<<"\n";
    else
    {
        d=s/c;
        f=s%c;
        for(i=1;i<=c;i++)
        {
            if(i<=f)
            a=a+(d+1)*(d+1);
            else
            a=a+d*d;
        }
        cout<<a<<"\n";
    }

}
	return 0;
}


#include <iostream>
using namespace std;

int main() {
//	cout<<"GfG!";
int t;
cin>>t;
while(t--)
{
    int c,s,d,f,i,a=0;
    cin>>c>>s;
    if(c>s)
    cout<<s*s<<"\n";
    else
    {
        d=s/c;
        f=s%c;
        for(i=1;i<=c;i++)
        {
            if(i<=f)
            a=a+(d+1)*(d+1);
            else
            a=a+d*d;
        }
        cout<<a<<"\n";
    }

}
	return 0;
}


//
//  Author: bin
//	Created:2019/11/27 21:49:15
//
#pragma optimization_level 3
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define endl '\n'
#define INF 0x3f3f3f3f
#define debug(x) cout<< #x " = "<<(x)<<endl;
#define pc(x) putchar(x)
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
mt19937 mrand(random_device{}());
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define BUF_SIZE 1000000
bool IOerror = 0;
char nc(){
static char buf[BUF_SIZE],*p1=buf+BUF_SIZE,*pend=buf+BUF_SIZE;
if(p1==pend){p1=buf;pend=buf+fread(buf,1,BUF_SIZE,stdin);
if(pend==p1){IOerror=1;return -1;}}return *p1++;}
bool blank(char ch){return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t';}
template<typename T>void read(T &x){
char ch;int f=1;while(blank(ch = nc()));
if(IOerror)return;if(ch=='-') f=-1,x=0;
else x = ch - '0';for(;(ch = nc()) >= '0' && ch <= '9'; x = x * 10 + ch - '0');
if(f==-1)x=-x;}
template<typename T, typename... Args>void read(T& x, Args&... args)
{ read(x), read(args...); }
#undef BUF_SIZE
const int N = 2e5+10;

int solve(){
	int a,b;
	cin>>a>>b;
	int t=b/a;
	int d=b-t*a;
	int ans=0;
	ans+=d*(t+1)*(t+1);
	ans+=(a-d)*t*t;
	cout<<ans<<endl;
	return 0;
}

signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int T;
	cin>>T;
	while(T--)
	solve();
	return 0;
}


//
//  Author: bin
//	Created:2019/11/27 21:49:15
//
#pragma optimization_level 3
//#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define endl '\n'
#define INF 0x3f3f3f3f
#define debug(x) cout<< #x " = "<<(x)<<endl;
#define pc(x) putchar(x)
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
#define BUF_SIZE 1000000
bool IOerror = 0;
char nc(){
static char buf[BUF_SIZE],*p1=buf+BUF_SIZE,*pend=buf+BUF_SIZE;
if(p1==pend){p1=buf;pend=buf+fread(buf,1,BUF_SIZE,stdin);
if(pend==p1){IOerror=1;return -1;}}return *p1++;}
bool blank(char ch){return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t';}
template<typename T>void read(T &x){
char ch;int f=1;while(blank(ch = nc()));
if(IOerror)return;if(ch=='-') f=-1,x=0;
else x = ch - '0';for(;(ch = nc()) >= '0' && ch <= '9'; x = x * 10 + ch - '0');
if(f==-1)x=-x;}
template<typename T, typename... Args>void read(T& x, Args&... args)
{ read(x), read(args...); }
#undef BUF_SIZE
const int N = 2e5+10;

int solve(){
	int a,b;
	cin>>a>>b;
	int t=b/a;
	int d=b-t*a;
	int ans=0;
	ans+=d*(t+1)*(t+1);
	ans+=(a-d)*t*t;
	cout<<ans<<endl;
	return 0;
}

signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int T;
	cin>>T;
	while(T--)
	solve();
	return 0;
}


#pragma GCC optimize(2)
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define x first
#define y second
typedef long long LL;
typedef pair<int, int> PII;

void solve(){
	int n, m; cin >> n >> m;
	int t = m / n; int p = m % n;
	LL ans = 0;
	ans += (t + 1) * (t + 1) * p + (n - p) * t * t;
	cout << ans << '\n';
}

int main(){
	ios::sync_with_stdio(false); cin.tie(nullptr);
	int T; cin >> T; while(T -- )
	solve(); return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,c,sum;
cin>>n;
while(n--)
{
cin>>c>>sum;
int rem=sum%c;
int d=sum/c;
int ans;
ans=rem*(d+1)*(d+1)+(c-rem)*d*d;
cout<<ans<<'\n';
}
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,ci,sumi;
int ans;
cin>>n;
while(n--)
{
cin>>ci>>sumi;
if(sumi<ci)
{
ans=sumi;
}
else
{
int d=sumi%ci;
long long int num=sumi*sumi;
int den=num/ci;
if(d==0)
{
ans=den;
}
else
{
int a=sumi/ci;
ans=d*(a+1)*(a+1)+a*(ci-d);
}
}
cout<<ans<<'\n';
}
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,ci,sumi;
cin>>n;
while(n--)
{
cin>>ci>>sumi;
if(sumi<ci)
cout<<sumi<<'\n';
else
{
long long int num=sumi*sumi;
cout<<num/ci<<'\n';
}
}
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,ci,sumi;
cin>>n;
while(n--)
{
cin>>ci>>sumi;
if(sumi<ci)
cout<<sumi;
else
{
long long int num=sumi*sumi;
cout<<num/ci<<'\n';
}
}
return 0;
}


#ifdef __APPLE__

    #include <cassert>
    #include <iostream>
    #include <iomanip>
    #include <ctime>
    #include <cstdio>
    #include <vector>
    #include <algorithm>
    #include <utility>
    #include <queue>
    #include <stack>
    #include <string>
    #include <cstring>
    #include <sstream>
    #include <map>
    #include <set>
    #include <unordered_map>
    #include <unordered_set>

#else

    #include <bits/stdc++.h>

#endif

#define ld long double
#define ll long long
#define mod 1000000007
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
    int i, n;
    cin >> n;
    ll a[n], b[n], ans = 0, x, y;
    for (i = 0; i < n; i++)
    {
        ans = 0;
        cin >> a[i] >> b[i];
        x = b[i] / a[i], y = b[i] % a[i];
        if (x != 0ll)
        {
            if (y == 0ll)
            {
                ans += x * x * a[i];
            }
            else
            {
                ans += max(y, (a[i] - y)) * x * x;
                ans += min(y, (a[i] - y)) * (x + 1) * (x + 1);
            }
        }
        else
        {
            ans += y;
        }
        cout << ans << '\n';
    }
	return 0;
}


#ifdef __APPLE__

    #include <cassert>
    #include <iostream>
    #include <iomanip>
    #include <ctime>
    #include <cstdio>
    #include <vector>
    #include <algorithm>
    #include <utility>
    #include <queue>
    #include <stack>
    #include <string>
    #include <cstring>
    #include <sstream>
    #include <map>
    #include <set>
    #include <unordered_map>
    #include <unordered_set>

#else

    #include <bits/stdc++.h>

#endif

#define ld long double
#define ll long long
#define mod 1000000007
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
    int i, n;
    cin >> n;
    ll a[n], b[n], ans, x, y;
    for (i = 0; i < n; i++)
    {
        ans = 0;
        cin >> a[i] >> b[i];
        x = b[i] / a[i], y = b[i] % a[i];
        if (x)
        {
            ans = (a[i] - y) * x * x;
            ans += y * (x + 1) * (x + 1);
        }
        else
            ans = y;
        cout << ans << '\n';
    }
	return 0;
}


#ifdef __APPLE__

    #include <cassert>
    #include <iostream>
    #include <iomanip>
    #include <ctime>
    #include <cstdio>
    #include <vector>
    #include <algorithm>
    #include <utility>
    #include <queue>
    #include <stack>
    #include <string>
    #include <cstring>
    #include <sstream>
    #include <map>
    #include <set>
    #include <unordered_map>
    #include <unordered_set>

#else

    #include <bits/stdc++.h>

#endif

#define ld long double
#define ll long long
#define mod 1000000007
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
    int i, n;
    cin >> n;
    ll a[n], b[n], ans, x, y;
    for (i = 0; i < n; i++)
    {
        ans = 0;
        cin >> a[i] >> b[i];
        x = b[i] / a[i], y = b[i] % a[i];
        if (x)
        {
            ans = max(y, (a[i] - y)) * x * x;
            ans += min(y, (a[i] - y)) * (x + 1) * (x + 1);
        }
        else
            ans = y;
        cout << ans << '\n';
    }
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define endl "\n"
#define ll long long int
#define u unsigned
#define loop(n) for(int i=0;i<n;i++)
#define rloop(n) for(int i=n-1;i>=0;i--)
#define read freopen("input.txt","r",stdin)
#define write freopen("output.txt","w",stdout)
#define ioboost ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)

int main()
{
    ioboost;
    int t;
    cin>>t;
    while(t--){
        ll a,b;
        cin>>a>>b;
        if(a>b or (a==1 or b==1)){
            cout<<b*b<<endl;
            continue;
        }
        if(b%a==0){
            cout<<pow(b/a,2)*a<<endl;
        }
        else{
            ll aa = b/a;
            ll bb = b%a;
            cout<<pow(aa+1,2)*bb+pow(aa,2)*(a-bb)<<endl;
        }
    }
    return 0;
}


L=[0]*200005
O=[0]*200005
F=[0]*200005
C=[]
czy=0
W=[[] for _ in range(4)]
P=[[] for _ in range(200005)]

def dfs(n,p):
    global czy
    O[n]=1
    if L[n]<=k-1:
        W[L[n]%2].append(n)
    for v in P[n]:
        #print(n,v,czy,L[n],L[v],O[v],p)
        if  O[v]==0:
            L[v]=L[n]+1;
            F[v]=n
            dfs(v,n)
        elif v!=p and czy==0 and L[n]>L[v] and L[n]-L[v]+1<=k:
            czy=1
            x=n
            while x!=v:
                C.append(x)
                x=F[x]
            C.append(v)

n,m,k=map(int,input().split())
for i in range(m):
    a,b=map(int,input().split())
    P[a].append(b)
    P[b].append(a)
dfs(1,0)
if czy:
    print(2)
    print(len(C))
    print(" ".join(map(str,C)))
else:
    print(1)
    if len(W[0])<len(W[1]):
        swap(W[0],W[1])
    x=k//2
    if k&1:
        x+=1
    s=""
    assert len(W[0][i])>=x
    for i in range(0,x):
        s+=str(W[0][i])+" "
    print(s)


L=[0]*200005
O=[0]*200005
F=[0]*200005
C=[]
czy=0
W=[[] for _ in range(4)]
P=[[] for _ in range(200005)]

def dfs(n,p):
    global czy
    O[n]=1
    if L[n]<=k-1:
        W[L[n]%2].append(n)
    for v in P[n]:
        #print(n,v,czy,L[n],L[v],O[v],p)
        if  O[v]==0:
            L[v]=L[n]+1;
            F[v]=n
            dfs(v,n)
        elif v!=p and czy==0 and L[n]>L[v] and L[n]-L[v]+1<=k:
            czy=1
            x=n
            while x!=v:
                C.append(x)
                x=F[x]
            C.append(v)

n,m,k=map(int,input().split())
for i in range(m):
    a,b=map(int,input().split())
    P[a].append(b)
    P[b].append(a)
dfs(1,0)
if n==100000:
    print("siemak")
    exit()
if czy:
    print(2)
    print(len(C))
    print(" ".join(map(str,C)))
else:
    print(1)
    if len(W[0])<len(W[1]):
        swap(W[0],W[1])
    x=k//2
    if k&1:
        x+=1
    s=""
    for i in range(0,x):
        s+=str(W[0][i])+" "
    print(s)


L=[0]*200005
O=[0]*200005
F=[0]*200005
C=[]
czy=0
W=[[] for _ in range(4)]
P=[[] for _ in range(200005)]

def dfs(n,p):
    global czy
    O[n]=1
    if L[n]<=k-1:
        W[L[n]%2].append(n)
    for v in P[n]:
        #print(n,v,czy,L[n],L[v],O[v],p)
        if  O[v]==0:
            L[v]=L[n]+1;
            F[v]=n
            dfs(v,n)
        elif v!=p and czy==0 and L[n]>L[v] and L[n]-L[v]+1<=k:
            czy=1
            x=n
            while x!=v:
                C.append(x)
                x=F[x]
            C.append(v)

n,m,k=map(int,input().split())
for i in range(m):
    a,b=map(int,input().split())
    P[a].append(b)
    P[b].append(a)
dfs(1,0)
if czy:
    print(2)
    print(len(C))
    print(" ".join(map(str,C)))
else:
    print(1)
    if len(W[0])<len(W[1]):
        swap(W[0],W[1])
    x=k//2
    if k&1:
        x+=1
    s=""
    assert len(W[i][i])>=x
    for i in range(0,x):
        s+=str(W[0][i])+" "
    print(s)


L=[0]*200005
O=[0]*200005
F=[0]*200005
C=[]
czy=0
W=[[] for _ in range(4)]
P=[[] for _ in range(200005)]
ile=0;
def dfs(n,p):
    stos=[]
    stos.append((n,p))
    global czy
    while len(stos)>0:
        n,p=stos[-1]
        stos.pop()
        if O[n]==1:
            continue
        O[n]=1
        if L[n]<=k-1:
            W[L[n]%2].append(n)
        for v in P[n]:
            #print(n,v,czy,L[n],L[v],O[v],p)
            if  O[v]==0:
                L[v]=L[n]+1;
                F[v]=n
                stos.append((v,n))
            elif v!=p and czy==0 and L[n]>L[v] and L[n]-L[v]+1<=k:
               # print("i am here",n,v)
                czy=1
                x=n
                while x!=v:
                    C.append(x)
                    x=F[x]
                C.append(v)
n,m,k=map(int,input().split())
for i in range(m):
    a,b=map(int,input().split())
    P[a].append(b)
    P[b].append(a)
dfs(1,0)
if czy:
    print(2)
    print(len(C))
    print(" ".join(map(str,C)))
else:
    print(1)
    A=[]
    if len(W[0])<len(W[1]):
        A=W[1]
    else:
        A=W[0]
    x=k//2
    if k&1:
        x+=1
    s=""
    for i in range(0,x):
        s+=str(A[i])+" "
    print(s)
#threading.Thread(target=main).start()


import sys
sys.setrecursionlimit(200000)
L=[0]*200005
O=[0]*200005
F=[0]*200005
C=[]
czy=0
W=[[] for _ in range(4)]
P=[[] for _ in range(200005)]
ile=0;
def dfs(n,p):
    stos=[]
    stos.append((n,p))
    global czy
    while len(stos)>0:
        n,p=stos[-1]
        stos.pop()
        if O[n]==1:
            continue
        O[n]=1
        if L[n]<=k-1:
            W[L[n]%2].append(n)
        for v in P[n]:
            #print(n,v,czy,L[n],L[v],O[v],p)
            if  O[v]==0:
                L[v]=L[n]+1;
                F[v]=n
                stos.append((v,n))
            elif v!=p and czy==0 and L[n]>L[v] and L[n]-L[v]+1<=k:
               # print("i am here",n,v)
                czy=1
                x=n
                while x!=v:
                    C.append(x)
                    x=F[x]
                C.append(v)
n,m,k=map(int,input().split())
for i in range(m):
    a,b=map(int,input().split())
    P[a].append(b)
    P[b].append(a)
dfs(1,0)
if czy:
    print(2)
    print(len(C))
    print(" ".join(map(str,C)))
else:
    print(1)
    if len(W[0])<len(W[1]):
        swap(W[0],W[1])
    x=k//2
    if k&1:
        x+=1
    s=""
    if len(W[0]<x)
        print("fatala error")
        exit()
    for i in range(0,x):
        s+=str(W[0][i])+" "
    print(s)
#threading.Thread(target=main).start()


import sys
sys.setrecursionlimit(200000)
L=[0]*200005
O=[0]*200005
F=[0]*200005
C=[]
czy=0
W=[[] for _ in range(4)]
P=[[] for _ in range(200005)]
ile=0;
def dfs(n,p):
    stos=[]
    stos.append((n,p))
    global czy
    while len(stos)>0:
        n,p=stos[-1]
        stos.pop()
        if O[n]==1:
            continue
        O[n]=1
        if L[n]<=k-1:
            W[L[n]%2].append(n)
        for v in P[n]:
            #print(n,v,czy,L[n],L[v],O[v],p)
            if  O[v]==0:
                L[v]=L[n]+1;
                F[v]=n
                stos.append((v,n))
            elif v!=p and czy==0 and L[n]>L[v] and L[n]-L[v]+1<=k:
               # print("i am here",n,v)
                czy=1
                x=n
                while x!=v:
                    C.append(x)
                    x=F[x]
                C.append(v)
n,m,k=map(int,input().split())
for i in range(m):
    a,b=map(int,input().split())
    P[a].append(b)
    P[b].append(a)
dfs(1,0)
if czy:
    print(2)
    print(len(C))
    print(" ".join(map(str,C)))
else:
    print(1)
    if len(W[0])<len(W[1]):
        swap(W[0],W[1])
    x=k//2
    if k&1:
        x+=1
    s=""
    if len(W[0])<x:
        print("fatala error")
        exit()
    for i in range(0,x):
        s+=str(W[0][i])+" "
    print(s)
#threading.Thread(target=main).start()


L=[0]*200005
O=[0]*200005
F=[0]*200005
C=[]
czy=0
W=[[] for _ in range(4)]
P=[[] for _ in range(200005)]

def dfs(n,p):
    global czy
    O[n]=1
    if L[n]<=k-1:
        W[L[n]%2].append(n)
    for v in P[n]:
        #print(n,v,czy,L[n],L[v],O[v],p)
        if  O[v]==0:
            L[v]=L[n]+1;
            F[v]=n
            dfs(v,n)
        elif v!=p and czy==0 and L[n]>L[v] and L[n]-L[v]+1<=k:
            czy=1
            x=n
            while x!=v:
                C.append(x)
                x=F[x]
            C.append(v)

n,m,k=map(int,input().split())
for i in range(m):
    a,b=map(int,input().split())
    P[a].append(b)
    P[b].append(a)
dfs(1,0)
if czy:
    print(2)
    print(len(C))
    print(" ".join(map(str,C)))
else:
    print(1)
    if len(W[0])<len(W[1]):
        swap(W[0],W[1])
    x=k//2
    if k&1:
        x+=1
    s=""
    assert len(W[0])>=x
    for i in range(0,x):
        s+=str(W[0][i])+" "
    print(s)


from collections import deque
from math import ceil
import sys
sys.setrecursionlimit(10**8)
back_edge = []
def dfs(node,visited,parent,level):
	# print("dfs",node)
	if len(back_edge)!=0:
		return
	visited[node]=True
	takenodes = []

	for i in adj[node]:
		if(visited[i] and parent[node]!=i):
			takenodes.append(i)

	if(len(takenodes)!=0):
		maximum_depth = -1
		max_node = -1
		for i in takenodes:
			if(level[i]>maximum_depth):
				maximum_depth = level[i]
				max_node = i
		# print("hella: ",node,max_node,maximum_depth)
		# print(visited)
		# print(parent)
		# print(takenodes)
		back_edge.append((node,max_node))
		return

	for i in adj[node]:
		if(not visited[i]):
			parent[i]=node
			level[i] = level[node]+1
			dfs(i,visited,parent,level)

n,m,k = map(int,input().split(" "))

adj = [[] for i in range(n+1)]
for i in range(m):
	a,b = map(int,input().split(" "))
	adj[a].append(b)
	adj[b].append(a)

if(m==n-1):
	q = deque()
	q.append(1)
	sign = [0]*(n+1)
	visited = [False]*(n+1)
	sign[1] = 0
	done = 0

	while done<n:
		curr = q.popleft()
		visited[curr] = True
		for i in adj[curr]:
			if(not visited[i]):
				q.append(i)
				sign[i] = 1 - sign[curr]
		done+=1
	l1 = []
	l0 = []

	for i in range(1,n+1):
		if(sign[i]==1):
			l0.append(i)
		else:
			l1.append(i)

	print(1)
	if(len(l0)>len(l1)):
		print(*l0[:ceil(k/2)])
	else:
		print(*l1[:ceil(k/2)])
else:
	parent = [0]*(n+1)
	visited = [False]*(n+1)
	level = [0]*(n+1)
	level[1] = 0
	try:
		dfs(1,visited,parent,level)
	except Exception as e:
		print(e)

	curr = back_edge[0][0]
	path = []
	while curr!=back_edge[0][1]:
		path.append(curr)
		curr = parent[curr]
	path.append(back_edge[0][1])
	if(len(path)<=k):
		print(2)
		print(len(path))
		print(*path)
	else:
		print(1)
		for i in range(0,len(path),2):
			print(path[i],end=" ")
		print()


from collections import deque
from math import ceil
import sys

sys.setrecursionlimit(10**8)
back_edge = []
visited = []
parent = []
level = []
def dfs(nod):
	stack = [nod]
	while stack:
		node = stack.pop()
		visited[node] =  True
		if len(back_edge)!=0:
			return
		visited[node]=True
		takenodes = []

		for i in adj[node]:
			if(visited[i] and parent[node]!=i):
				takenodes.append(i)

		if(len(takenodes)!=0):
			maximum_depth = -1
			max_node = -1
			for i in takenodes:
				if(level[i]>maximum_depth):
					maximum_depth = level[i]
					max_node = i
			back_edge.append((node,max_node))
			return

		for i in adj[node]:
			if(not visited[i]):
				parent[i]=node
				level[i] = level[node]+1
				stack.append(i)

n,m,k = map(int,input().split(" "))

adj = [[] for i in range(n+1)]
for i in range(m):
	a,b = map(int,input().split(" "))
	adj[a].append(b)
	adj[b].append(a)

if(m==n-1):
	q = deque()
	q.append(1)
	sign = [0]*(n+1)
	visited = [False]*(n+1)
	sign[1] = 0
	done = 0

	while done<n:
		curr = q.popleft()
		visited[curr] = True
		for i in adj[curr]:
			if(not visited[i]):
				q.append(i)
				sign[i] = 1 - sign[curr]
		done+=1
	l1 = []
	l0 = []

	for i in range(1,n+1):
		if(sign[i]==1):
			l0.append(i)
		else:
			l1.append(i)

	print(1)
	if(len(l0)>len(l1)):
		print(*l0[:ceil(k/2)])
	else:
		print(*l1[:ceil(k/2)])
else:
	parent = [0]*(n+1)
	visited = [False]*(n+1)
	level = [0]*(n+1)
	level[1] = 0
	try:
		dfs(1)
	except Exception as e:
		print(e)

	curr = back_edge[0][0]
	path = []
	while curr!=back_edge[0][1]:
		path.append(curr)
		curr = parent[curr]
	path.append(back_edge[0][1])
	if(len(path)<=k):
		print(2)
		print(len(path))
		print(*path)
	else:
		print(1)
		doned = 0
		for i in range(0,len(path),2):
			if(doned==ceil(k/2)):
				break
			doned+=1
			print(path[i],end=" ")
		print()


from collections import deque
from math import ceil
import sys

sys.setrecursionlimit(10**8)
back_edge = []
visited = []
parent = []
level = []
def dfs(nod):
	stack = [nod]
	while stack:
		node = stack.pop()
		visited[node] =  True
		if len(back_edge)!=0:
			return
		visited[node]=True
		takenodes = []

		for i in adj[node]:
			if(visited[i] and parent[node]!=i):
				takenodes.append(i)

		if(len(takenodes)!=0):
			maximum_depth = -1
			max_node = -1
			for i in takenodes:
				if(level[i]>maximum_depth):
					maximum_depth = level[i]
					max_node = i
			back_edge.append((node,max_node))
			return

		for i in adj[node]:
			if(not visited[i]):
				parent[i]=node
				level[i] = level[node]+1
				stack.append(i)

n,m,k = map(int,input().split(" "))

adj = [[] for i in range(n+1)]
for i in range(m):
	a,b = map(int,input().split(" "))
	adj[a].append(b)
	adj[b].append(a)

if(m==n-1):
	q = deque()
	q.append(1)
	sign = [0]*(n+1)
	visited = [False]*(n+1)
	sign[1] = 0
	done = 0

	while done<n:
		curr = q.popleft()
		visited[curr] = True
		for i in adj[curr]:
			if(not visited[i]):
				q.append(i)
				sign[i] = 1 - sign[curr]
		done+=1
	l1 = []
	l0 = []

	for i in range(1,n+1):
		if(sign[i]==1):
			l0.append(i)
		else:
			l1.append(i)

	print(1)
	if(len(l0)>len(l1)):
		print(*l0[:ceil(k/2)])
	else:
		print(*l1[:ceil(k/2)])
else:
	parent = [0]*(n+1)
	visited = [False]*(n+1)
	level = [0]*(n+1)
	level[1] = 0
	try:
		dfs(1)
	except Exception as e:
		print(e)

	curr = back_edge[0][0]
	path = []
	while curr!=back_edge[0][1]:
		path.append(curr)
		curr = parent[curr]
	path.append(back_edge[0][1])
	if(len(path)<=k):
		print(2)
		print(len(path))
		print(*path)
	else:
		print(1)
		for i in range(0,len(path),2):
			print(path[i],end=" ")
		print()


from collections import deque
from math import ceil
import sys

sys.setrecursionlimit(10**8)
back_edge = []
visited = []
parent = []
level = []
def dfs(node):
	# print("dfs",node)
	if len(back_edge)!=0:
		return
	visited[node]=True
	takenodes = []

	for i in adj[node]:
		if(visited[i] and parent[node]!=i):
			takenodes.append(i)

	if(len(takenodes)!=0):
		maximum_depth = -1
		max_node = -1
		for i in takenodes:
			if(level[i]>maximum_depth):
				maximum_depth = level[i]
				max_node = i
		# print("hella: ",node,max_node,maximum_depth)
		# print(visited)
		# print(parent)
		# print(takenodes)
		back_edge.append((node,max_node))
		return

	for i in adj[node]:
		if(not visited[i]):
			parent[i]=node
			level[i] = level[node]+1
			dfs(i)

n,m,k = map(int,input().split(" "))

adj = [[] for i in range(n+1)]
for i in range(m):
	a,b = map(int,input().split(" "))
	adj[a].append(b)
	adj[b].append(a)

if(m==n-1):
	q = deque()
	q.append(1)
	sign = [0]*(n+1)
	visited = [False]*(n+1)
	sign[1] = 0
	done = 0

	while done<n:
		curr = q.popleft()
		visited[curr] = True
		for i in adj[curr]:
			if(not visited[i]):
				q.append(i)
				sign[i] = 1 - sign[curr]
		done+=1
	l1 = []
	l0 = []

	for i in range(1,n+1):
		if(sign[i]==1):
			l0.append(i)
		else:
			l1.append(i)

	print(1)
	if(len(l0)>len(l1)):
		print(*l0[:ceil(k/2)])
	else:
		print(*l1[:ceil(k/2)])
else:
	parent = [0]*(n+1)
	visited = [False]*(n+1)
	level = [0]*(n+1)
	level[1] = 0
	try:
		dfs(1)
	except Exception as e:
		print(e)

	curr = back_edge[0][0]
	path = []
	while curr!=back_edge[0][1]:
		path.append(curr)
		curr = parent[curr]
	path.append(back_edge[0][1])
	if(len(path)<=k):
		print(2)
		print(len(path))
		print(*path)
	else:
		print(1)
		for i in range(0,len(path),2):
			print(path[i],end=" ")
		print()


from collections import deque
from math import ceil
import sys
sys.setrecursionlimit(10**6)
back_edge = []
def dfs(node,visited,parent,level):
	# print("dfs",node)
	if len(back_edge)!=0:
		return
	visited[node]=True
	takenodes = []

	for i in adj[node]:
		if(visited[i] and parent[node]!=i):
			takenodes.append(i)

	if(len(takenodes)!=0):
		maximum_depth = -1
		max_node = -1
		for i in takenodes:
			if(level[i]>maximum_depth):
				maximum_depth = level[i]
				max_node = i
		# print("hella: ",node,max_node,maximum_depth)
		# print(visited)
		# print(parent)
		# print(takenodes)
		back_edge.append((node,max_node))
		return

	for i in adj[node]:
		if(not visited[i]):
			parent[i]=node
			level[i] = level[node]+1
			dfs(i,visited,parent,level)

n,m,k = map(int,input().split(" "))

adj = [[] for i in range(n+1)]
for i in range(m):
	a,b = map(int,input().split(" "))
	adj[a].append(b)
	adj[b].append(a)

if(m==n-1):
	q = deque()
	q.append(1)
	sign = [0]*(n+1)
	visited = [False]*(n+1)
	sign[1] = 0
	done = 0

	while done<n:
		curr = q.popleft()
		visited[curr] = True
		for i in adj[curr]:
			if(not visited[i]):
				q.append(i)
				sign[i] = 1 - sign[curr]
		done+=1
	l1 = []
	l0 = []

	for i in range(1,n+1):
		if(sign[i]==1):
			l0.append(i)
		else:
			l1.append(i)

	print(1)
	if(len(l0)>len(l1)):
		print(*l0[:ceil(k/2)])
	else:
		print(*l1[:ceil(k/2)])
else:
	parent = [0]*(n+1)
	visited = [False]*(n+1)
	level = [0]*(n+1)
	level[1] = 0
	dfs(1,visited,parent,level)

	curr = back_edge[0][0]
	path = []
	while curr!=back_edge[0][1]:
		path.append(curr)
		curr = parent[curr]
	path.append(back_edge[0][1])
	if(len(path)<=k):
		print(2)
		print(len(path))
		print(*path)
	else:
		print(1)
		for i in range(0,len(path),2):
			print(path[i],end=" ")
		print()


from collections import deque
from math import ceil
import sys
sys.setrecursionlimit(10**8)
back_edge = []
def dfs(node,visited,parent,level):
	# print("dfs",node)
	if len(back_edge)!=0:
		return
	visited[node]=True
	takenodes = []

	for i in adj[node]:
		if(visited[i] and parent[node]!=i):
			takenodes.append(i)

	if(len(takenodes)!=0):
		maximum_depth = -1
		max_node = -1
		for i in takenodes:
			if(level[i]>maximum_depth):
				maximum_depth = level[i]
				max_node = i
		# print("hella: ",node,max_node,maximum_depth)
		# print(visited)
		# print(parent)
		# print(takenodes)
		back_edge.append((node,max_node))
		return

	for i in adj[node]:
		if(not visited[i]):
			parent[i]=node
			level[i] = level[node]+1
			dfs(i,visited,parent,level)

n,m,k = map(int,input().split(" "))

adj = [[] for i in range(n+1)]
for i in range(m):
	a,b = map(int,input().split(" "))
	adj[a].append(b)
	adj[b].append(a)

if(m==n-1):
	q = deque()
	q.append(1)
	sign = [0]*(n+1)
	visited = [False]*(n+1)
	sign[1] = 0
	done = 0

	while done<n:
		curr = q.popleft()
		visited[curr] = True
		for i in adj[curr]:
			if(not visited[i]):
				q.append(i)
				sign[i] = 1 - sign[curr]
		done+=1
	l1 = []
	l0 = []

	for i in range(1,n+1):
		if(sign[i]==1):
			l0.append(i)
		else:
			l1.append(i)

	print(1)
	if(len(l0)>len(l1)):
		print(*l0[:ceil(k/2)])
	else:
		print(*l1[:ceil(k/2)])
else:
	parent = [0]*(n+1)
	visited = [False]*(n+1)
	level = [0]*(n+1)
	level[1] = 0
	dfs(1,visited,parent,level)

	curr = back_edge[0][0]
	path = []
	while curr!=back_edge[0][1]:
		path.append(curr)
		curr = parent[curr]
	path.append(back_edge[0][1])
	if(len(path)<=k):
		print(2)
		print(len(path))
		print(*path)
	else:
		print(1)
		for i in range(0,len(path),2):
			print(path[i],end=" ")
		print()


from collections import deque
from math import ceil
import sys

sys.setrecursionlimit(10**8)
back_edge = []
visited = []
parent = []
level = []
def dfs(nod):
	stack = [nod]
	while stack:
		node = stack.pop()
		visited[node] =  True
		if len(back_edge)!=0:
			return
		visited[node]=True
		takenodes = []

		for i in adj[node]:
			if(visited[i] and parent[node]!=i):
				takenodes.append(i)

		if(len(takenodes)!=0):
			maximum_depth = -1
			max_node = -1
			for i in takenodes:
				if(level[i]>maximum_depth):
					maximum_depth = level[i]
					max_node = i
			back_edge.append((node,max_node))
			return

		for i in adj[node]:
			if(not visited[i]):
				parent[i]=node
				level[i] = level[node]+1
				stack.append(i)

n,m,k = map(int,input().split(" "))

adj = [[] for i in range(n+1)]
for i in range(m):
	a,b = map(int,input().split(" "))
	adj[a].append(b)
	adj[b].append(a)

if(m==n-1):
	q = deque()
	q.append(1)
	sign = [0]*(n+1)
	visited = [False]*(n+1)
	sign[1] = 0
	done = 0

	while done<n:
		curr = q.popleft()
		visited[curr] = True
		for i in adj[curr]:
			if(not visited[i]):
				q.append(i)
				sign[i] = 1 - sign[curr]
		done+=1
	l1 = []
	l0 = []

	for i in range(1,n+1):
		if(sign[i]==1):
			l0.append(i)
		else:
			l1.append(i)

	print(1)
	if(len(l0)>len(l1)):
		print(*l0[:ceil(k/2)])
	else:
		print(*l1[:ceil(k/2)])
else:
	parent = [0]*(n+1)
	visited = [False]*(n+1)
	level = [0]*(n+1)
	level[1] = 0
	try:
		dfs(1)
	except Exception as e:
		print(e)

	curr = back_edge[0][0]
	path = []
	while curr!=back_edge[0][1]:
		path.append(curr)
		curr = parent[curr]
	path.append(back_edge[0][1])
	if(len(path)<=k):
		print(2)
		print(len(path))
		print(*path)
	else:
		print(1)
		doned = 0
		for i in range(0,len(path),2):
			if(doned==k):
				break
			doned+=1
			print(path[i],end=" ")
		print()


from math import ceil
#input = sys.stdin.readline

n, m, req = map(int, input().split())
e = [tuple(map(int, input().split())) for _ in range(m)]
g = [[] for _ in range(n + 1)]
for u, v in e:g[u].append(v);g[v].append(u)

def dfs():
    dep = [0] * (n + 1)
    par = [0] * (n + 1)
    st = [1]
    st2 = []
    while st:
        u = st.pop()
        if dep[u]:continue
        st2.append(u)
        dep[u] = dep[par[u]] + 1
        for v in g[u]:
            if not dep[v]:par[v] = u;st.append(v)
            elif 2 < dep[u] - dep[v] + 1 <= req:
                cyc = []
                while u != par[v]:cyc.append(u);u = par[u]
                return (None, cyc)
    mk,iset = [0] * (n + 1),[]
    while st2:
        u = st2.pop()
        if not mk[u]:
            iset.append(u)
            for v in g[u]:mk[v] = 1
    return (iset[:ceil(req/2)], None)

iset, cyc = dfs()
if iset:
    print(1)
    print(*iset)
else:
    print(2)
    print(len(cyc))
    print(*cyc)


from math import ceil

n, m, req = map(int, input().split())
e = [tuple(map(int, input().split())) for _ in range(m)]
g = [[] for _ in range(n + 1)]
for u, v in e:g[u].append(v);g[v].append(u)

def dfs():
    dep,par,st,st2 = [0] * (n + 1),[0] * (n + 1),[1],[]
    while st:
        u = st.pop()
        if dep[u]:continue
        st2.append(u);dep[u] = dep[par[u]] + 1
        for v in g[u]:
            if not dep[v]:par[v] = u;st.append(v)
            elif 2 < dep[u] - dep[v] + 1 <= req:
                cyc = []
                while u != par[v]:cyc.append(u);u = par[u]
                return (None, cyc)
    mk = [0] * (n + 1)
    iset = []
    while st2:
        u = st2.pop()
        if not mk[u]:
            iset.append(u)
            for v in g[u]:
                mk[v] = 1
    return (iset[:ceil(req/2)], None)

iset, cyc = dfs()
print(1);print(*iset) if iset else print(2);print(len(cyc));print(*cyc)


from math import ceil
n, m, req = map(int, input().split());e = [tuple(map(int, input().split())) for _ in range(m)];g = [[] for _ in range(n + 1)]
for u, v in e:g[u].append(v);g[v].append(u)
def dfs():
    dep = [0] * (n + 1);par = [0] * (n + 1);st = [1];st2 = []
    while st:
        u = st.pop()
        if dep[u]:continue
        st2.append(u);dep[u] = dep[par[u]] + 1
        for v in g[u]:
            if not dep[v]:par[v] = u;st.append(v)
            elif 2 < dep[u] - dep[v] + 1 <= req:
                cyc = []
                while u != par[v]:cyc.append(u);u = par[u]
                return (None, cyc)
    mk,iset = [0] * (n + 1),[]
    while st2:
        u = st2.pop()
        if not mk[u]:
            iset.append(u)
            for v in g[u]:mk[v] = 1
    return (iset[:ceil(req/2)], None)
iset, cyc = dfs()
if iset:print(1);print(*iset)
else:print(2);print(len(cyc));print(*cyc)


from math import ceil
#input = sys.stdin.readline

n, m, req = map(int, input().split())
e = [tuple(map(int, input().split())) for _ in range(m)]
g = [[] for _ in range(n + 1)]
for u, v in e:g[u].append(v);g[v].append(u)

def dfs():
    dep = [0] * (n + 1);par = [0] * (n + 1);st = [1];st2 = []
    while st:
        u = st.pop()
        if dep[u]:continue
        st2.append(u)
        dep[u] = dep[par[u]] + 1
        for v in g[u]:
            if not dep[v]:par[v] = u;st.append(v)
            elif 2 < dep[u] - dep[v] + 1 <= req:
                cyc = []
                while u != par[v]:cyc.append(u);u = par[u]
                return (None, cyc)
    mk,iset = [0] * (n + 1),[]
    while st2:
        u = st2.pop()
        if not mk[u]:
            iset.append(u)
            for v in g[u]:mk[v] = 1
    return (iset[:ceil(req/2)], None)

iset, cyc = dfs()
if iset:print(1);print(*iset)
else:print(2);print(len(cyc));print(*cyc)


import sys
from math import ceil
#input = sys.stdin.readline

n, m, req = map(int, input().split())
e = [tuple(map(int, input().split())) for _ in range(m)]
g = [[] for _ in range(n + 1)]
for u, v in e:
    g[u].append(v)
    g[v].append(u)

def dfs():
    dep = [0] * (n + 1)
    par = [0] * (n + 1)
    st = [1]
    st2 = []
    while st:
        u = st.pop()
        if dep[u]:
            continue
        st2.append(u)
        dep[u] = dep[par[u]] + 1
        for v in g[u]:
            if not dep[v]:
                par[v] = u
                st.append(v)
            elif 2 < dep[u] - dep[v] + 1 <= req:
                cyc = []
                while u != par[v]:
                    cyc.append(u)
                    u = par[u]
                return (None, cyc)
    mk = [0] * (n + 1)
    iset = []
    while st2:
        u = st2.pop()
        if not mk[u]:
            iset.append(u)
            for v in g[u]:
                mk[v] = 1
    return (iset[:ceil(req/2)], None)

iset, cyc = dfs()
if iset:
    print(1)
    print(*iset)
else:
    print(2)
    print(len(cyc))
    print(*cyc)


from math import ceil

n, m, req = map(int, input().split())
e = [tuple(map(int, input().split())) for _ in range(m)]
g = [[] for _ in range(n + 1)]
for u, v in e:g[u].append(v);g[v].append(u)

def dfs():
    dep = [0] * (n + 1);par = [0] * (n + 1);st = [1];st2 = []
    while st:
        u = st.pop()
        if dep[u]:continue
        st2.append(u);dep[u] = dep[par[u]] + 1
        for v in g[u]:
            if not dep[v]:par[v] = u;st.append(v)
            elif 2 < dep[u] - dep[v] + 1 <= req:
                cyc = []
                while u != par[v]:cyc.append(u);u = par[u]
                return (None, cyc)
    mk,iset = [0] * (n + 1),[]
    while st2:
        u = st2.pop()
        if not mk[u]:
            iset.append(u)
            for v in g[u]:mk[v] = 1
    return (iset[:ceil(req/2)], None)

iset, cyc = dfs()
print(1);print(*iset) if iset else print(2);print(len(cyc));print(*cyc)


from sys import stdin,stdout,setrecursionlimit
import threading

threading.stack_size(2**26)
setrecursionlimit(10**9)

line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)//2

graph = [[] for _ in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)

        else:
            current_length = depth[vertex] - depth[ady] + 1
            if 3 <= current_length <= k:
                stdout.write("2\n")
                cycle = []
                i = vertex
                while i != ady:
                    cycle.append(i)
                    i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
                for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                    stdout.write("{} ".format(cycle[elem]))
                exit(0)

def DFS_Cycle() :
    for vertex in range(1,len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]

    for elem in range(0,ceiling) :
        stdout.write("{} ".format(bigger_set[elem]))

threading.Thread(target = DFS_Cycle()).start()


from sys import stdin,stdout,setrecursionlimit
import threading

threading.stack_size(2**26)
setrecursionlimit(10**9)
line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)/2

graph = [[] for _ in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)
        else:
            current_length = depth[vertex] - depth[ady] + 1
            if 3 <= current_length <= k:
                stdout.write("2\n")
                cycle = []
                i = vertex
                while i != ady:
                    cycle.append(i)
                    i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
                for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                    stdout.write("{} ".format(cycle[elem]))
                exit(0)

def DFS_Cycle() :
    for vertex in range(1,len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex + 1)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]
    for elem in bigger_set:
        stdout.write("{} ".format(elem))

threading.Thread(target = DFS_Cycle).start()


from sys import stdin,stdout,setrecursionlimit
import threading

threading.stack_size(2**26)
setrecursionlimit(10**9)
line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)//2

graph = [[] for _ in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)
        else:
            current_length = depth[vertex] - depth[ady] + 1
            if 3 <= current_length <= k:
                stdout.write("2\n")
                cycle = []
                i = vertex
                while i != ady:
                    cycle.append(i)
                    i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
                for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                    stdout.write("{} ".format(cycle[elem]))
                exit(0)

def DFS_Cycle() :
    for vertex in range(1,len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]
    for elem in range(0,ceiling):
        stdout.write("{} ".bigger_set[elem])

threading.Thread(target = DFS_Cycle).start()


from sys import stdin,stdout,setrecursionlimit
import threading

threading.stack_size(2**26)
setrecursionlimit(10**9)
line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)/2

graph = [[] for _ in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)
        else:
            current_length = depth[vertex] - depth[ady] + 1
            if 3 <= current_length <= k:
                stdout.write("2\n")
                cycle = []
                i = vertex
                while i != ady:
                    cycle.append(i)
                    i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
                for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                    stdout.write("{} ".format(cycle[elem]))
                exit(0)

def DFS_Cycle() :
    for vertex in range(1,len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]
    for elem in range(0,ceiling):
        stdout.write("{} ".bigger_set[elem])

threading.Thread(target = DFS_Cycle).start()


from sys import stdin,stdout,setrecursionlimit
import threading

threading.stack_size(2**26)
setrecursionlimit(10**9)

line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)//2

graph = [[] for _ in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)

        else:
            current_length = depth[vertex] - depth[ady] + 1
            if 3 <= current_length <= k:
                stdout.write("2\n")
                cycle = []
                i = vertex
                while i != ady:
                    cycle.append(i)
                    i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
                for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                    stdout.write("{} ".format(cycle[elem]))
                exit(0)

def DFS_Cycle() :
    for vertex in range(1,len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex + 1)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]

    for elem in range(0,ceiling,1) :
        stdout.write("{} ".format(bigger_set[elem]))

threading.Thread(target = DFS_Cycle()).start()


from sys import stdin,stdout,setrecursionlimit
import threading

threading.stack_size(2**26)
setrecursionlimit(10**9)

line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)/2

graph = [[] for _ in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)

    else:
        current_length = depth[vertex] - depth[ady] + 1
        if 3 <= current_length <= k:
            stdout.write("2\n")
            cycle = []
            i = vertex
            while i != ady:
                cycle.append(i)
                i = parents[i]
            cycle.append(ady)
            stdout.write("{}\n".format(len(cycle)))
            for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                stdout.write("{} ".format(cycle[elem]))
            exit(0)

def DFS_Cycle() :
    for vertex in range(1,len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex + 1)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]

    for elem in bigger_set:
        stdout.write("{} ".format(elem))

threading.Thread(target = DFS_Cycle).start()


from sys import stdin,stdout,setrecursionlimit
import threading

threading.stack_size(2**26)
setrecursionlimit(10**9)
line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)/2

graph = [[] for _ in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)

        else:
            current_length = depth[vertex] - depth[ady] + 1
            if 3 <= current_length <= k:
                stdout.write("2\n")
                cycle = []
                i = vertex
                while i != ady:
                    cycle.append(i)
                    i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
                for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                    stdout.write("{} ".format(cycle[elem]))
                exit(0)

def DFS_Cycle() :
    for vertex in range(1,len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex + 1)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]
    for elem in bigger_set:
        stdout.write("{} ".format(elem))

threading.Thread(target = DFS_Cycle).start()


from sys import stdin,stdout,setrecursionlimit
import threading

threading.stack_size(2**26)
setrecursionlimit(10**9)
line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)//2

graph = [[] for _ in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)
        else:
            current_length = depth[vertex] - depth[ady] + 1
            if 3 <= current_length <= k:
                stdout.write("2\n")
                cycle = []
                i = vertex
                while i != ady:
                    cycle.append(i)
                    i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
                for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                    stdout.write("{} ".format(cycle[elem]))
                exit(0)

def DFS_Cycle() :
    for vertex in range(1,len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]
    for elem in range(0,ceiling):
        stdout.write("{} ".format(bigger_set[elem]))

threading.Thread(target = DFS_Cycle).start()


from sys import stdin,stdout,setrecursionlimit

setrecursionlimit(10**9)
line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)/2

graph = [[] for _ in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)

        else:
            current_length = depth[vertex] - depth[ady] + 1
            if 3 <= current_length <= k:
                stdout.write("2\n")
                cycle = []
                i = vertex
                while i != ady:
                    cycle.append(i)
                    i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
                for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                    stdout.write("{} ".format(cycle[elem]))
                exit(0)

def DFS_Cycle() :
    for vertex in range(len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex + 1)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]
    for elem in bigger_set:
        stdout.write("{} ".format(elem))

DFS_Cycle()


from sys import stdin,stdout,setrecursionlimit
import threading

threading.stack_size(2**26)
setrecursionlimit(10**9)
line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)/2

graph = [[] for _ in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)
        else:
            current_length = depth[vertex] - depth[ady] + 1
            if 3 <= current_length <= k:
                stdout.write("2\n")
                cycle = []
                i = vertex
                while i != ady:
                    cycle.append(i)
                    i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
                for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                    stdout.write("{} ".format(cycle[elem]))
                exit(0)

def DFS_Cycle() :
    for vertex in range(1,len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex + 1)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]
    for elem in range(0,ceiling):
        stdout.write("{} ".format(bigger_set[elem]))

threading.Thread(target = DFS_Cycle).start()


    from sys import stdin,stdout,setrecursionlimit
    import threading

    threading.stack_size(2**26)
    setrecursionlimit(10**9)
    line1 =[int(x) for x in stdin.readline().split()]
    vertexes = line1[0]
    edges = line1[1]
    k = line1[2]
    ceiling = k//2 if k % 2 == 0 else (k + 1)/2

    graph = [[] for _ in range (vertexes + 1)]
    parents = [-1 for _ in range(vertexes + 1)]
    visited = [0 for _ in range(vertexes + 1)]
    depth = [0 for _ in range(vertexes + 1)]
    sets = [[] for _ in range(2)]

    while edges > 0 :
        line1 = [int(x) for x in stdin.readline().split()]
        edges -= 1
        graph[line1[0]].append(line1[1])
        graph[line1[1]].append(line1[0])

    def DFS_Cycle_Visit(vertex) :
        visited[vertex] = 1
        if depth[vertex] < k :
            sets[depth[vertex] % 2].append(vertex)

        for ady in graph[vertex]:
            if visited[ady] == 0 :
                parents[ady] = vertex
                depth[ady] = depth[vertex] + 1
                DFS_Cycle_Visit(ady)

            else:
                current_length = depth[vertex] - depth[ady] + 1
                if 3 <= current_length <= k:
                    stdout.write("2\n")
                    cycle = []
                    i = vertex
                    while i != ady:
                        cycle.append(i)
                        i = parents[i]
                    cycle.append(ady)
                    stdout.write("{}\n".format(len(cycle)))
                    for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                        stdout.write("{} ".format(cycle[elem]))
                    exit(0)

    def DFS_Cycle() :
        for vertex in range(1,len(graph)):
            if visited[vertex] == 0 :
                DFS_Cycle_Visit(vertex + 1)

        stdout.write("1\n")
        bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]
        for elem in bigger_set:
            stdout.write("{} ".format(elem))

    threading.Thread(target = DFS_Cycle).start()


from sys import stdin,stdout,setrecursionlimit
import threading

threading.stack_size(2**26)
setrecursionlimit(10**9)
line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)//2

graph = [[] for _ in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)
        else:
            current_length = depth[vertex] - depth[ady] + 1
            if 3 <= current_length <= k:
                stdout.write("2\n")
                cycle = []
                i = vertex
                while i != ady:
                    cycle.append(i)
                    i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
                for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                    stdout.write("{} ".format(cycle[elem]))
                exit(0)

def DFS_Cycle() :
    for vertex in range(1,len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex + 1)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]
    for elem in range(0,ceiling):
        stdout.write("{} ".format(bigger_set[elem]))

threading.Thread(target = DFS_Cycle).start()


from sys import stdin,stdout,setrecursionlimit
import threading

threading.stack_size(2**26)
setrecursionlimit(10**9)

line1 =[int(x) for x in stdin.readline().split()]
vertices = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)//2

graph = [[] for _ in range (vertices + 1)]
parents = [-1 for _ in range(vertices + 1)]
visited = [0 for _ in range(vertices + 1)]
depth = [0 for _ in range(vertices + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)
        else:
            current_length = depth[vertex] - depth[ady] + 1
            if 3 <= current_length <= k:
                stdout.write("2\n")
                cycle = []
                i = vertex
                while i != ady:
                    cycle.append(i)
                    i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
                for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                    stdout.write("{} ".format(cycle[elem]))
                exit(0)

def DFS_Cycle() :
    for vertex in range(1,len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]
    for elem in range(0,ceiling):
        stdout.write("{} ".format(bigger_set[elem]))

threading.Thread(target = DFS_Cycle()).start()


from sys import stdin,stdout,setrecursionlimit
import threading

threading.stack_size(2**26)
setrecursionlimit(10**9)

line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)/2

graph = [[] for _ in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)

    else:
        current_length = depth[vertex] - depth[ady] + 1
        if 3 <= current_length <= k:
            stdout.write("2\n")
            cycle = []
            i = vertex
            while i != ady:
                cycle.append(i)
                i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
            for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                stdout.write("{} ".format(cycle[elem]))
            exit(0)

def DFS_Cycle() :
    for vertex in range(1,len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex + 1)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]
    for elem in bigger_set:
        stdout.write("{} ".format(elem))

threading.Thread(target = DFS_Cycle).start()


from sys import stdin,stdout,setrecursionlimit

setrecursionlimit(10**6)
line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)/2

graph = [[] for _s in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)

        else:
            current_length = depth[vertex] - depth[ady] + 1
            if 3 <= current_length <= k:
                stdout.write("2\n")
                cycle = []
                i = vertex
                while i != ady:
                    cycle.append(i)
                    i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
                for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                    stdout.write("{} ".format(cycle[elem]))
                exit(0)

def DFS_Cycle() :
    for vertex in range(len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex + 1)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]
    for elem in bigger_set:
        stdout.write("{} ".format(elem))

DFS_Cycle()


from sys import stdin,stdout,setrecursionlimit

setrecursionlimit(5*10**5)
line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)/2

graph = [[] for _s in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)

        else:
            current_length = depth[vertex] - depth[ady] + 1
            if 3 <= current_length <= k:
                stdout.write("2\n")
                cycle = []
                i = vertex
                while i != ady:
                    cycle.append(i)
                    i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
                for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                    stdout.write("{} ".format(cycle[elem]))
                exit(0)

def DFS_Cycle() :
    for vertex in range(len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex + 1)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]
    for elem in bigger_set:
        stdout.write("{} ".format(elem))

DFS_Cycle()


from sys import stdin,stdout,setrecursionlimit

setrecursionlimit(10**9)
line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)/2

graph = [[] for _ in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)

        else:
            current_length = depth[vertex] - depth[ady] + 1
            if 3 <= current_length <= k:
                stdout.write("2\n")
                cycle = []
                i = vertex
                while i != ady:
                    cycle.append(i)
                    i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
                for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                    stdout.write("{} ".format(cycle[elem]))
                exit(0)

def DFS_Cycle() :
    for vertex in range(1,len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex + 1)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]
    for elem in bigger_set:
        stdout.write("{} ".format(elem))

DFS_Cycle()


from sys import stdin,stdout,setrecursionlimit
import threading

threading.stack_size(2**26)
setrecursionlimit(10**9)

line1 =[int(x) for x in stdin.readline().split()]
vertices = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)//2

graph = [[] for _ in range (vertices + 1)]
parents = [-1 for _ in range(vertices + 1)]
visited = [0 for _ in range(vertices + 1)]
depth = [0 for _ in range(vertices + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)
        else:
            current_length = depth[vertex] - depth[ady] + 1
            if 3 <= current_length <= k:
                stdout.write("2\n")
                cycle = []
                i = vertex
                while i != ady:
                    cycle.append(i)
                    i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
                for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                    stdout.write("{} ".format(cycle[elem]))
                exit(0)

def DFS_Cycle() :
    for vertex in range(1,len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex + 1)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]
    for elem in range(0,ceiling):
        stdout.write("{} ".format(bigger_set[elem]))

threading.Thread(target = DFS_Cycle()).start()


from sys import stdin,stdout,setrecursionlimit
import threading

threading.stack_size(2**26)
setrecursionlimit(10**9)

line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)/2

graph = [[] for _ in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)

        else:
            current_length = depth[vertex] - depth[ady] + 1
            if 3 <= current_length <= k:
                stdout.write("2\n")
                cycle = []
                i = vertex
                while i != ady:
                    cycle.append(i)
                    i = parents[i]
                cycle.append(ady)
                stdout.write("{}\n".format(len(cycle)))
                for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                    stdout.write("{} ".format(cycle[elem]))
                exit(0)

def DFS_Cycle() :
    for vertex in range(1,len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex + 1)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]

    for elem in range(0,ceiling,1) :
        stdout.write("{} ".format(bigger_set[elem]))

threading.Thread(target = DFS_Cycle()).start()


from sys import stdin,stdout,setrecursionlimit
import threading

threading.stack_size(2**26)
setrecursionlimit(10**9)

line1 =[int(x) for x in stdin.readline().split()]
vertexes = line1[0]
edges = line1[1]
k = line1[2]
ceiling = k//2 if k % 2 == 0 else (k + 1)/2

graph = [[] for _ in range (vertexes + 1)]
parents = [-1 for _ in range(vertexes + 1)]
visited = [0 for _ in range(vertexes + 1)]
depth = [0 for _ in range(vertexes + 1)]
sets = [[] for _ in range(2)]

while edges > 0 :
    line1 = [int(x) for x in stdin.readline().split()]
    edges -= 1
    graph[line1[0]].append(line1[1])
    graph[line1[1]].append(line1[0])

def DFS_Cycle_Visit(vertex) :
    visited[vertex] = 1
    if depth[vertex] < k :
        sets[depth[vertex] % 2].append(vertex)

    for ady in graph[vertex]:
        if visited[ady] == 0 :
            parents[ady] = vertex
            depth[ady] = depth[vertex] + 1
            DFS_Cycle_Visit(ady)

    else:
        current_length = depth[vertex] - depth[ady] + 1
        if 3 <= current_length <= k:
            stdout.write("2\n")
            cycle = []
            i = vertex
            while i != ady:
                cycle.append(i)
                i = parents[i]
            cycle.append(ady)
            stdout.write("{}\n".format(len(cycle)))
            for elem in range(len(cycle)-1,-1,-1):  #reversed(cycle) is also right, elem instead of cycle[elem]
                stdout.write("{} ".format(cycle[elem]))
            exit(0)

def DFS_Cycle() :
    for vertex in range(1,len(graph)):
        if visited[vertex] == 0 :
            DFS_Cycle_Visit(vertex)

    stdout.write("1\n")
    bigger_set = sets[0]  if len(sets[0]) >= len(sets[1]) else sets[1]

    for elem in bigger_set:
        stdout.write("{} ".format(elem))

threading.Thread(target = DFS_Cycle()).start()


import sys
from collections import deque

n, m, k = map(int, input().split())
e = [[] for _ in range(n + 1)]
for _ in range(m):
    a, b = map(int, input().split())
    e[a].append(b)
    e[b].append(a)

def get_root():
    q = deque([1])
    par = [0] * (n+1)
    par[1] = 1
    while q:
        u = q.popleft()
        for v in e[u]:
            if v == par[u]:
                continue
            if par[v] > 0:
                return u
            else:
                par[v] = u
                q.append(v)
    return 1
root = get_root()

def print_cycle(u, v, par):
    up, vp = [], []
    while u != root:
        up.append(u)
        u = par[u]
    while v != root:
        vp.append(v)
        v = par[v]
    cy = up + [root] + list(reversed(vp))
    print(2)
    print(len(cy))
    print(*cy)
    exit()

q = deque([root])
par = [0]*(n+1); par[root] = root
dep = [0]*(n+1); dep[1] = 1
col0, col1 = [], []
while q:
    u = q.popleft()
    if dep[u] % 2:
        col0.append(u)
    else:
        col1.append(u)
    if len(col0) + len(col1) == k:
        break
    for v in e[u]:
        if v == par[u]:
            continue
        if par[v] > 0:
            if dep[u]+dep[v]-1 <= k:
                print_cycle(u, v, par)
        else:
            par[v] = u
            dep[v] = dep[u] + 1
            q.append(v)
res = col0 if len(col0) >= len(col1) else col1
res = [res[i] for i in range((k+1)//2)]
print(1)
print(*res)


import sys
from collections import deque

n, m, k = map(int, input().split())
e = [[] for _ in range(n + 1)]
for _ in range(m):
    a, b = map(int, input().split())
    e[a].append(b)
    e[b].append(a)

def get_root():
    q = deque([1])
    par = [0] * (n+1)
    par[1] = 1
    while q:
        u = q.popleft()
        for v in e[u]:
            if v == par[u]:
                continue
            if par[v] > 0:
                return u
            else:
                par[v] = u
                q.append(v)
    return 1
root = get_root()

def print_cycle(u, v, par):
    up, vp = [], []
    while u != root:
        up.append(u)
        u = par[u]
    while v != root:
        #vp.append(v)
        v = par[v]
    cy = up + [root] + list(reversed(vp))
    print(2)
    print(len(cy))
    print(*cy)
    exit()

q = deque([root])
par = [0]*(n+1); par[root] = root
dep = [0]*(n+1); dep[1] = 1
col0, col1 = [], []
while q:
    u = q.popleft()
    if dep[u] % 2:
        col0.append(u)
    else:
        col1.append(u)
    if len(col0) + len(col1) == k:
        break
    for v in e[u]:
        if v == par[u]:
            continue
        if par[v] > 0:
            if dep[u]+dep[v]-1 <= k:
                print_cycle(u, v, par)
        else:
            par[v] = u
            dep[v] = dep[u] + 1
            q.append(v)
res = col0 if len(col0) >= len(col1) else col1
res = [res[i] for i in range((k+1)//2)]
print(1)
print(*res)


from sys import stdin, stdout
from itertools import repeat
def main():
    n, m, k = map(int, stdin.readline().split())
    dat = map(int, stdin.read().split(), repeat(10, 2 * m))
    la = [None] * (n + 1)
    xt = [None] * (2 * m)
    j = 0
    for i in xrange(m):
        x, y = dat[j], dat[j+1]
        xt[j] = la[y]
        la[y] = j
        j += 1
        xt[j] = la[x]
        la[x] = j
        j += 1
    st = [(1, -1)]
    pu = st.append
    po = st.pop
    col = [0] * (n + 1)
    dep = [0] * (n + 1)
    mxd = [0] * (n + 1)
    par = [-1] * (n + 1)
    ch = [[] for _ in xrange(n + 1)]
    while st:
        v, p = po()
        if p != -1 and dep[p] >= k - 1:
            ans = []
            while p != -1:
                ans.append(p)
                p = par[p]
            ans = ans[::2]
            stdout.write('1\n')
            stdout.write(' '.join(map(str, ans)))
            return
        if not col[v]:
            col[v] = 1
            pu((v, p))
            y = la[v]
            while y is not None:
                z = dat[y]
                if z != p:
                    if col[z] == 1:
                        if dep[v] - dep[z] <= k - 1:
                            ans = [z]
                            while v != z:
                                ans.append(v)
                                v = par[v]
                            stdout.write('2\n' + str(len(ans)) + '\n')
                            stdout.write(' '.join(map(str, ans)))
                            return
                    else:
                        dep[z] = dep[v] + 1
                        ch[v].append(z)
                        par[z] = v
                        pu((z, v))
                y = xt[y]
    s = sum(dep[i] % 2 for i in xrange(1, n + 1))
    h = (k + 1) / 2
    if s >= h:
        ans = [i for i in xrange(1, n + 1) if dep[i] % 2][:h]
    else:
        ans = [i for i in xrange(1, n + 1) if dep[i] % 2 == 0][:h]
    stdout.write('1\n')
    stdout.write(' '.join(map(str, ans)))
main()


from sys import stdin, stdout
from itertools import repeat
def main():
    n, m, k = map(int, stdin.readline().split())
    dat = map(int, stdin.read().split(), repeat(10, 2 * m))
    la = [None] * (n + 1)
    xt = [None] * (2 * m)
    j = 0
    for i in xrange(m):
        x, y = dat[j], dat[j+1]
        xt[j] = la[y]
        la[y] = j
        j += 1
        xt[j] = la[x]
        la[x] = j
        j += 1
    st = [(1, -1)]
    pu = st.append
    po = st.pop
    dep = [0] * (n + 1)
    par = [-1] * (n + 1)
    col = [0] * (n + 1)
    it = [la[i] for i in xrange(n + 1)]
    h = (k + 1) / 2
    while st:
        v, p = po()
        col[v] = 1
        if it[v] is None:
            if dep[v] >= h * 2 - 2:
                ans = []
                while v != -1:
                    ans.append(v)
                    v = par[v]
                ans = ans[::2]
                stdout.write('1\n')
                stdout.write(' '.join(map(str, ans)))
                return
            continue
        pu((v, p))
        z = dat[it[v]]
        it[v] = xt[it[v]]
        if z != p:
            if col[z] == 1:
                if dep[v] - dep[z] <= k - 1:
                        ans = [z]
                        while v != z:
                            ans.append(v)
                            v = par[v]
                        stdout.write('2\n' + str(len(ans)) + '\n')
                        stdout.write(' '.join(map(str, ans)))
                        return
            else:
                dep[z] = dep[v] + 1
                par[z] = v
                pu((z, v))
    ans = [i for i in xrange(1, n + 1) if dep[i] % 2][:h]
    if len(ans) < h:
        ans = [i for i in xrange(1, n + 1) if dep[i] % 2 == 0][:h]
    stdout.write('1\n')
    stdout.write(' '.join(map(str, ans)))
main()


from sys import stdin, stdout
from itertools import repeat
def main():
    n, m, k = map(int, stdin.readline().split())
    dat = map(int, stdin.read().split(), repeat(10, 2 * m))
    la = [None] * (n + 1)
    xt = [None] * (2 * m)
    j = 0
    for i in xrange(m):
        x, y = dat[j], dat[j+1]
        xt[j] = la[y]
        la[y] = j
        j += 1
        xt[j] = la[x]
        la[x] = j
        j += 1
    st = [(1, -1)]
    pu = st.append
    po = st.pop
    col = [0] * (n + 1)
    dep = [0] * (n + 1)
    mxd = [0] * (n + 1)
    par = [-1] * (n + 1)
    h = (k + 1) / 2
    while st:
        v, p = po()
        if not col[v]:
            col[v] = 1
            pu((v, p))
            y = la[v]
            while y is not None:
                z = dat[y]
                if z != p:
                    if col[z] == 1:
                        if dep[v] - dep[z] <= k - 1:
                            ans = [z]
                            while v != z:
                                ans.append(v)
                                v = par[v]
                            stdout.write('2\n' + str(len(ans)) + '\n')
                            stdout.write(' '.join(map(str, ans)))
                            return
                    else:
                        dep[z] = dep[v] + 1
                        par[z] = v
                        pu((z, v))
                y = xt[y]
        elif dep[v] >= h * 2 - 1:
            ans = []
            while v != -1:
                ans.append(v)
                v = par[v]
            ans = ans[::2]
            stdout.write('1\n')
            stdout.write(' '.join(map(str, ans)))
            return
    s = sum(dep[i] % 2 for i in xrange(1, n + 1))
    if s >= h:
        ans = [i for i in xrange(1, n + 1) if dep[i] % 2][:h]
    else:
        ans = [i for i in xrange(1, n + 1) if dep[i] % 2 == 0][:h]
    stdout.write('1\n')
    stdout.write(' '.join(map(str, ans)))
main()


from sys import stdin, stdout
from itertools import repeat
def main():
    n, m, k = map(int, stdin.readline().split())
    dat = map(int, stdin.read().split(), repeat(10, 2 * m))
    la = [None] * (n + 1)
    xt = [None] * (2 * m)
    j = 0
    for i in xrange(m):
        x, y = dat[j], dat[j+1]
        xt[j] = la[y]
        la[y] = j
        j += 1
        xt[j] = la[x]
        la[x] = j
        j += 1
    st = [(1, -1)]
    pu = st.append
    po = st.pop
    col = [0] * (n + 1)
    dep = [0] * (n + 1)
    mxd = [0] * (n + 1)
    par = [-1] * (n + 1)
    ch = [[] for _ in xrange(n + 1)]
    while st:
        v, p = po()
        if p != -1 and dep[p] >= k:
            ans = []
            while p != -1:
                ans.append(p)
                p = par[p]
            ans = ans[::2]
            stdout.write('1\n')
            stdout.write(' '.join(map(str, ans)))
            return
        if not col[v]:
            col[v] = 1
            pu((v, p))
            y = la[v]
            while y is not None:
                z = dat[y]
                if z != p:
                    if col[z] == 1:
                        if dep[v] - dep[z] <= k - 1:
                            ans = [z]
                            while v != z:
                                ans.append(v)
                                v = par[v]
                            stdout.write('2\n' + str(len(ans)) + '\n')
                            stdout.write(' '.join(map(str, ans)))
                            return
                    else:
                        dep[z] = dep[v] + 1
                        ch[v].append(z)
                        par[z] = v
                        pu((z, v))
                y = xt[y]
    s = sum(dep[i] % 2 for i in xrange(1, n + 1))
    h = (k + 1) / 2
    if s >= h:
        ans = [i for i in xrange(1, n + 1) if dep[i] % 2][:h]
    else:
        ans = [i for i in xrange(1, n + 1) if dep[i] % 2 == 0][:h]
    stdout.write('1\n')
    stdout.write(' '.join(map(str, ans)))
main()


from sys import stdin, stdout
from itertools import repeat
def main():
    n, m, k = map(int, stdin.readline().split())
    dat = map(int, stdin.read().split(), repeat(10, 2 * m))
    la = [None] * (n + 1)
    xt = [None] * (2 * m)
    j = 0
    for i in xrange(m):
        x, y = dat[j], dat[j+1]
        xt[j] = la[y]
        la[y] = j
        j += 1
        xt[j] = la[x]
        la[x] = j
        j += 1
    st = [(1, -1)]
    pu = st.append
    po = st.pop
    dep = [0] * (n + 1)
    par = [-1] * (n + 1)
    col = [0] * (n + 1)
    it = [la[i] for i in xrange(n + 1)]
    h = (k + 1) / 2
    while st:
        v, p = po()
        col[v] = 1
        if it[v] is None:
            if dep[v] >= h * 2 - 2:
                ans = []
                while v != -1:
                    ans.append(v)
                    v = par[v]
                ans = ans[::2][:h]
                stdout.write('1\n')
                stdout.write(' '.join(map(str, ans)))
                return
            continue
        pu((v, p))
        z = dat[it[v]]
        it[v] = xt[it[v]]
        if z != p:
            if col[z] == 1:
                if dep[v] - dep[z] <= k - 1:
                        ans = [z]
                        while v != z:
                            ans.append(v)
                            v = par[v]
                        stdout.write('2\n' + str(len(ans)) + '\n')
                        stdout.write(' '.join(map(str, ans)))
                        return
            else:
                dep[z] = dep[v] + 1
                par[z] = v
                pu((z, v))
    ans = [i for i in xrange(1, n + 1) if dep[i] % 2][:h]
    if len(ans) < h:
        ans = [i for i in xrange(1, n + 1) if dep[i] % 2 == 0][:h]
    stdout.write('1\n')
    stdout.write(' '.join(map(str, ans)))
main()


from sys import stdin, stdout
from itertools import repeat
def main():
    n, m, k = map(int, stdin.readline().split())
    dat = map(int, stdin.read().split(), repeat(10, 2 * m))
    la = [None] * (n + 1)
    xt = [None] * (2 * m)
    j = 0
    for i in xrange(m):
        x, y = dat[j], dat[j+1]
        xt[j] = la[y]
        la[y] = j
        j += 1
        xt[j] = la[x]
        la[x] = j
        j += 1
    st = [(1, -1)]
    pu = st.append
    po = st.pop
    dep = [0] * (n + 1)
    par = [-1] * (n + 1)
    col = [0] * (n + 1)
    it = [la[i] for i in xrange(n + 1)]
    h = (k + 1) / 2
    while st:
        v, p = po()
        col[v] = 1
        if it[v] is None:
            if dep[v] >= h * 2 - 1:
                ans = []
                while v != -1:
                    ans.append(v)
                    v = par[v]
                ans = ans[::2]
                stdout.write('1\n')
                stdout.write(' '.join(map(str, ans)))
                return
            continue
        pu((v, p))
        z = dat[it[v]]
        it[v] = xt[it[v]]
        if z != p:
            if col[z] == 1:
                if dep[v] - dep[z] <= k - 1:
                        ans = [z]
                        while v != z:
                            ans.append(v)
                            v = par[v]
                        stdout.write('2\n' + str(len(ans)) + '\n')
                        stdout.write(' '.join(map(str, ans)))
                        return
            else:
                dep[z] = dep[v] + 1
                par[z] = v
                pu((z, v))
    ans = [i for i in xrange(1, n + 1) if dep[i] % 2][:h]
    if len(ans) < h:
        ans = [i for i in xrange(1, n + 1) if dep[i] % 2 == 0][:h]
    stdout.write('1\n')
    stdout.write(' '.join(map(str, ans)))
main()


#include <stdio.h>

#define N	100000
#define M	200000

int oo[1 + M * 2], oj[1 + M * 2];

int link(int o, int j) {
	static int _ = 1;

	oo[_] = o, oj[_] = j;
	return _++;
}

int ae[N], pp[N], dd[N], k, qu[N], cnt;

int dfs(int p, int i, int d) {
	int o;

	pp[i] = p, dd[i] = d;
	for (o = ae[i]; o; o = oo[o]) {
		int j = oj[o];

		if (j != p) {
			if (!dd[j]) {
				if (dfs(i, j, d + 1))
					return 1;
			} else if (dd[j] < dd[i] && dd[i] - dd[j] + 1 <= k) {
				int j_ = i;

				cnt = 0;
				while (j_ != j) {
					qu[cnt++] = j_;
					j_ = pp[j_];
				}
				qu[cnt++] = j_;
				return 1;
			}
		}
	}
	return 0;
}

int main() {
	int n, m, h, i, j, k0;

	scanf("%d%d%d", &n, &m, &k);
	for (h = 0; h < m; h++) {
		scanf("%d%d", &i, &j), i--, j--;
		ae[i] = link(ae[i], j);
		ae[j] = link(ae[j], i);
	}
	if (dfs(-1, 0, 1)) {
		printf("2\n");
		printf("%d\n", cnt);
		while (cnt--)
			printf("%d ", qu[cnt] + 1);
		printf("\n");
		return 0;
	}
	cnt = 0, k0 = 0;
	for (i = 0; i < n; i++) {
		if (dd[i] % 2 == 0)
			k0++;
		if (dd[i] == k) {
			while (1) {
				qu[cnt++] = i;
				if (pp[i] == -1 || pp[pp[i]] == -1)
					break;
				i = pp[pp[i]];
			}
			break;
		}
	}
	if (cnt == 0) {
		if (k0 > n - k0) {
			for (i = 0; i < n; i++)
				if (dd[i] % 2 == 0)
					qu[cnt++] = i;
		} else {
			for (i = 0; i < n; i++)
				if (dd[i] % 2 == 1)
					qu[cnt++] = i;
		}
	}
	printf("1\n");
	for (h = 0; h < (k + 1) / 2; h++)
		printf("%d ", qu[h] + 1);
	printf("\n");
	return 0;
}