                                        /******SHOW US THE BEST YOU CAN DO******/

#include<bits/stdc++.h>

using namespace std;

#define ll long long int

ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}

const int N = 1e5 + 10;

vector<int>ad[N], path;
int vis[N], col[N], n, m, k, f;
void dfs(int v, int c){
    col[v] = c;
    for(auto u : ad[v]){
        if(col[u] == c){
            f = 1;
            return;
        }
        if(!col[u])
            dfs(u, 3 - c);
    }
}

void dfs(int v){
    vis[v] = 1;
    path.push_back(v);
    for(auto u : ad[v]){
        if(vis[u] == 1){
            vector<int>t;
            int idx = (int)path.size() - 1;
            while(path[idx] != u)t.push_back(path[idx--]);
            t.push_back(u);
            if((int)t.size() <= k && (int)t.size() >= 3){
                printf("%d\n%d\n", 2, (int)t.size());
                for(auto u : t)printf("%d ", u);
                puts("");
                exit(0);
            }
        }else if(vis[u] == 0)
            dfs(u);
    }
    vis[v] = 2;
    path.pop_back();
}

int myceil(int a, int b){
    return (a + b - 1) / b;
}

int main(){
    //freopen("output.in","r",stdin);
    //freopen("output.txt","w",stdout);
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 1; i <= m; i++){
        int x, y;
        scanf("%d%d", &x, &y);
        ad[x].push_back(y);
        ad[y].push_back(x);
    }
    dfs(1, 1);
    if(!f){
        int cntr = 0;
        for(int i = 1; i <= n; i++)if(col[i] == 2)cntr++;
        int need = myceil(n, 2);
        int c = -1;
        if(cntr == need)c = 2;
        else if(n - cntr == need)c = 1;
        if(c == -1)goto fin;
        puts("1");
        for(int i = 1; i <= n; i++)
            if(col[i] == c)printf("%d ", i);
        puts("");
        return 0;
    }
    fin:;
    dfs(1);

    return 0;
}


                                        /******SHOW US THE BEST YOU CAN DO******/

#include<bits/stdc++.h>

using namespace std;

#define ll long long int

ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}

const int N = 1e5 + 10;

vector<int>ad[N], path;
int vis[N], p[N], n, m, k, f, d[N], st, en;

void dfs(int v, int dep){
    vis[v] = 1;
    d[v] = dep;
    for(auto u : ad[v]){
        if(u == p[v])continue;
        if(vis[u]){
            if(d[v] > d[u]){
                int da = d[v] - d[u] + 1;
                if(da <= k){
                    vector<int>t;
                    int cur = v;
                    st = v;
                    en = u;
                    while(cur != u)t.push_back(cur), cur = p[cur];
                    t.push_back(u);
                    printf("%d\n%d\n", 2, (int)t.size());
                    for(auto u : t)printf("%d ", u);
                    puts("");
                    exit(0);
                }
            }
        }else{
            p[u] = v;
            dfs(u, dep + 1);
        }
    }
}

int main(){
    //freopen("output.in","r",stdin);
    //freopen("output.txt","w",stdout);
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 1; i <= m; i++){
        int x, y;
        scanf("%d%d", &x, &y);
        ad[x].push_back(y);
        ad[y].push_back(x);
    }
    dfs(1, 1);
    puts("1");
    vector<int>o, e;
    for(int i = 1; i <= n; i++)if(d[i]&1)o.push_back(i);else e.push_back(i);
    if(o.size() >= (k + 1) / 2){
        for(int i = 0; i < (k + 1) / 2; i++)
            printf("%d ", o[i]);
        puts("");
        return 0;
    }else if(e.size() >= (k + 1) / 2){
        for(int i = 0; i < (k + 1) / 2; i++)
            printf("%d ", e[i]);
        puts("");
        return 0;
    }
    vector<int>ans;
    while(st != 0 && d[st] >= d[en]){
        ans.push_back(st);
        st = p[st];
        st = p[st];
    }
    assert(ans.size() >= (k + 1) / 2);
    for(int i = 0; i < (k + 1) / 2; i++)printf("%d ", ans[i]);puts("");
    return 0;
}


                                        /******SHOW US THE BEST YOU CAN DO******/

#include<bits/stdc++.h>

using namespace std;

#define ll long long int

ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}

const int N = 1e5 + 10;

vector<int>ad[N], ans, path;
int vis[N], col[N], n, m, k, f;
void dfs(int v, int c){
    col[v] = c;
    for(auto u : ad[v]){
        if(col[u] == c){
            f = 1;
            return;
        }
        if(!col[u])
            dfs(u, 3 - c);
    }
}

void dfs(int v){
    vis[v] = 1;
    path.push_back(v);
    for(auto u : ad[v]){
        if(vis[u] == 1){
            vector<int>t;
            int idx = (int)path.size() - 1;
            while(path[idx] != u)t.push_back(path[idx--]);
            t.push_back(u);
            if((int)t.size() - 1 <= k && (int)t.size() >= 3 && ans.size() == 0){
                ans = t;
            }
        }else if(vis[u] == 0)
            dfs(u);
    }
    vis[v] = 2;
    path.pop_back();
}

int myceil(int a, int b){
    return (a + b - 1) / b;
}

int main(){
    //freopen("output.in","r",stdin);
    //freopen("output.txt","w",stdout);
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 1; i <= m; i++){
        int x, y;
        scanf("%d%d", &x, &y);
        ad[x].push_back(y);
        ad[y].push_back(x);
    }
    dfs(1, 1);
    if(!f){
        int cntr = 0;
        for(int i = 1; i <= n; i++)if(col[i] == 2)cntr++;
        int need = myceil(n, 2);
        int c = -1;
        if(cntr == need)c = 2;
        else if(n - cntr == need)c = 1;
        if(c == -1)goto fin;
        puts("1");
        for(int i = 1; i <= n; i++)
            if(col[i] == c)printf("%d ", i);
        puts("");
        return 0;
    }
    fin:;
    dfs(1);
    printf("%d\n%d\n", 2, (int)ans.size());
    for(auto u : ans)printf("%d ", u);
    puts("");
    return 0;
}


                                        /******SHOW US THE BEST YOU CAN DO******/

#include<bits/stdc++.h>

using namespace std;

#define ll long long int

ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}

const int N = 1e5 + 10;

vector<int>ad[N], path;
int vis[N], p[N], n, m, k, f, d[N], st, en;

int mn = 1e9;
void dfs(int v, int dep){
    vis[v] = 1;
    d[v] = dep;
    for(auto u : ad[v]){
        if(u == p[v])continue;
        if(vis[u]){
            if(d[v] > d[u]){
                int da = d[v] - d[u] + 1;
                if(da <= k){
                    vector<int>t;
                    int cur = v;
                    while(cur != u)t.push_back(cur), cur = p[cur];
                    t.push_back(u);
                    printf("%d\n%d\n", 2, (int)t.size());
                    for(auto u : t)printf("%d ", u);
                    puts("");
                    exit(0);
                }else if(abs(da) < mn){
                    st = v;
                    en = u;
                    mn = abs(da);
                }
            }
        }else{
            p[u] = v;
            dfs(u, dep + 1);
        }
    }
}

int main(){
    //freopen("output.in","r",stdin);
    //freopen("output.txt","w",stdout);
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 1; i <= m; i++){
        int x, y;
        scanf("%d%d", &x, &y);
        ad[x].push_back(y);
        ad[y].push_back(x);
    }
    dfs(1, 1);
    puts("1");
    vector<int>o, e;
    for(int i = 1; i <= n; i++)if(d[i]%2)o.push_back(i);else e.push_back(i);
    if(o.size() >= (k + 1) / 2){
        for(int i = 0; i < (k + 1) / 2; i++)
            printf("%d ", o[i]);
        puts("");
        return 0;
    }else {
        for(int i = 0; i < (k + 1) / 2; i++)
            printf("%d ", e[i]);
        puts("");
        return 0;
    }
    vector<int>ans;
    while(st != 0 && d[st] >= d[en]){
        ans.push_back(st);
        st = p[st];
        st = p[st];
    }
    assert(ans.size() >= (k + 1) / 2);
    for(int i = 0; i < (k + 1) / 2; i++)printf("%d ", ans[i]);puts("");
    return 0;
}


                                        /******SHOW US THE BEST YOU CAN DO******/

#include<bits/stdc++.h>

using namespace std;

#define ll long long int

ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}

const int N = 1e5 + 10;

vector<int>ad[N], ans, path;
int vis[N], col[N], n, m, k, f;
void dfs(int v, int c){
    col[v] = c;
    for(auto u : ad[v]){
        if(col[u] == c){
            f = 1;
            return;
        }
        if(!col[u])
            dfs(u, 3 - c);
    }
}

void dfs(int v){
    vis[v] = 1;
    path.push_back(v);
    for(auto u : ad[v]){
        if(vis[u] == 1){
            vector<int>t;
            int idx = (int)path.size() - 1;
            while(path[idx] != u)t.push_back(path[idx--]);
            t.push_back(u);
            if((int)t.size() - 1 <= k && ans.size() < 3){
                swap(ans, t);
                return;
            }
        }else if(vis[u] == 0)
            dfs(u);
    }
    vis[v] = 2;
    path.pop_back();
}

int myceil(int a, int b){
    return (a + b - 1) / b;
}

int main(){
    //freopen("output.in","r",stdin);
    //freopen("output.txt","w",stdout);
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 1; i <= m; i++){
        int x, y;
        scanf("%d%d", &x, &y);
        ad[x].push_back(y);
        ad[y].push_back(x);
    }
    dfs(1, 1);
    if(!f){
        int cntr = 0;
        for(int i = 1; i <= n; i++)if(col[i] == 2)cntr++;
        int need = myceil(n, 2);
        int c = -1;
        if(cntr == need)c = 2;
        else if(n - cntr == need)c = 1;
        if(c == -1)goto fin;
        puts("1");
        for(int i = 1; i <= n; i++)
            if(col[i] == c)printf("%d ", i);
        puts("");
        return 0;
    }
    fin:;
    dfs(1);
    printf("%d\n%d\n", 2, (int)ans.size());
    for(auto u : ans)printf("%d ", u);
    puts("");
    return 0;
}


                                        /******SHOW US THE BEST YOU CAN DO******/

#include<bits/stdc++.h>

using namespace std;

#define ll long long int

ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}

const int N = 1e5 + 10;

vector<int>ad[N], path;
int vis[N], col[N], n, m, k, f, d[N];
void dfs(int v, int c){
    col[v] = c;
    for(auto u : ad[v]){
        if(col[u] && col[u] == c){
            f = 1;
            return;
        }
        if(!col[u])
            dfs(u, 3 - c);
    }
}

void dfs(int v){
    vis[v] = 1;
    path.push_back(v);
    for(auto u : ad[v]){
        if(vis[u] == 1){
            vector<int>t;
            int idx = (int)path.size() - 1;
            while(path[idx] != u)t.push_back(path[idx--]);
            t.push_back(u);
            if((int)t.size() <= k && (int)t.size() >= 3){
                printf("%d\n%d\n", 2, (int)t.size());
                for(auto u : t)printf("%d ", u);
                puts("");
                exit(0);
            }
        }else if(vis[u] == 0){
            d[u] = d[v] + 1;
            dfs(u);
        }
    }
    vis[v] = 2;
    path.pop_back();
}

int myceil(int a, int b){
    return (a + b - 1) / b;
}

int main(){
    //freopen("output.in","r",stdin);
    //freopen("output.txt","w",stdout);
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 1; i <= m; i++){
        int x, y;
        scanf("%d%d", &x, &y);
        ad[x].push_back(y);
        ad[y].push_back(x);
    }
    dfs(1, 1);
    if(!f){
        int cntr = 0;
        for(int i = 1; i <= n; i++)if(col[i] == 2)cntr++;
        int need = myceil(n, 2);
        int c = -1;
        if(cntr >= need)c = 2;
        else if(n - cntr >= need)c = 1;
        if(c == -1)goto fin;
        puts("1");
        for(int i = 1; i <= n; i++)
            if(col[i] == c)printf("%d ", i);
        puts("");
        return 0;
    }
    fin:;
    dfs(1);
    puts("1");
    vector<int>o, e;
    for(int i = 1; i <= n; i++)if(d[i]&1)o.push_back(i);else e.push_back(i);
    if(o.size() >= myceil(n, 2)){
        for(int i = 0; i < myceil(n, 2); i++)
            printf("%d ", o[i]);
        puts("");
    }else{
        for(int i = 0; i < myceil(n, 2); i++)
            printf("%d ", e[i]);
        puts("");
    }
    return 0;
}


                                        /******SHOW US THE BEST YOU CAN DO******/

#include<bits/stdc++.h>

using namespace std;

#define ll long long int

ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}

const int N = 1e5 + 10;

vector<int>ad[N], path;
int vis[N], p[N], n, m, k, f, d[N], st, en;

int mn = 1e9;
void dfs(int v, int pa = 0){
    if(pa == -1){
        d[v] = 0;
    }else{
        d[v] = d[pa] + 1;
    }
    p[v] = pa;
    vis[v] = 1;
    for(auto u : ad[v]){
        if(u == p[v])continue;
        if(vis[u]){
            int st = v;
            int en = u;
            if(d[st] < d[en])swap(st, en);
            if(d[st] - d[en] + 1 < mn){
                mn = d[st] - d[en] + 1;
                ::st = st;
                ::en = en;
            }
        }else{
            dfs(u, v);
        }
    }
}

int main(){
    //freopen("output.in","r",stdin);
    //freopen("output.txt","w",stdout);
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 1; i <= m; i++){
        int x, y;
        scanf("%d%d", &x, &y);
        ad[x].push_back(y);
        ad[y].push_back(x);
    }
    dfs(1);
    if(mn == 1e9){
        puts("1");
        vector<int>o, e;
        for(int i = 1; i <= n; i++)if(d[i]%2)o.push_back(i);else e.push_back(i);
        if(o.size() >= (k + 1) / 2){
            for(int i = 0; i < (k + 1) / 2; i++)
                printf("%d ", o[i]);
            puts("");
        }else {
            for(int i = 0; i < (k + 1) / 2; i++)
                printf("%d ", e[i]);
            puts("");
        }
        return 0;
    }
    if(mn <= k){
        vector<int>t;
        while(st != en){
            t.push_back(st);
            st = p[st];
        }
        t.push_back(en);
        puts("2");
        printf("%d\n", (int)t.size());
        for(auto u : t)printf("%d ", u);
        puts("");
        return 0;
    }
    puts("1");
    vector<int>ans;
    while(st != 0 && d[st] >= d[en]){
        ans.push_back(st);
        st = p[st];
        st = p[st];
    }
    assert(ans.size() >= (k + 1) / 2);
    for(int i = 0; i < (k + 1) / 2; i++)printf("%d ", ans[i]);puts("");
    return 0;
}


                                        /******SHOW US THE BEST YOU CAN DO******/

#include<bits/stdc++.h>

using namespace std;

#define ll long long int

ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}

const int N = 1e5 + 10;

vector<int>ad[N], path;
int vis[N], col[N], p[N], n, m, k, f, d[N];
void dfs(int v, int c){
    col[v] = c;
    for(auto u : ad[v]){
        if(col[u] && col[u] == c){
            f = 1;
            return;
        }
        if(!col[u])
            dfs(u, 3 - c);
    }
}

void dfss(int v, int dep){
    vis[v] = 1;
    d[v] = dep;
    for(auto u : ad[v]){
        if(u == p[v])continue;
        if(vis[u]){
            if(d[v] > d[u]){
                int da = d[v] - d[u] + 1;
                if(da <= k){
                    vector<int>t;
                    int cur = v;
                    while(cur != u)t.push_back(cur), cur = p[cur];
                    t.push_back(u);
                    printf("%d\n%d\n", 2, (int)t.size());
                    for(auto u : t)printf("%d ", u);
                    puts("");
                    exit(0);
                }
            }
        }else{
            p[u] = v;
            dfss(u, dep + 1);
        }
    }
}

int main(){
    //freopen("output.in","r",stdin);
    //freopen("output.txt","w",stdout);
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 1; i <= m; i++){
        int x, y;
        scanf("%d%d", &x, &y);
        ad[x].push_back(y);
        ad[y].push_back(x);
    }
    dfs(1, 1);
    if(!f){
        int cntr = 0;
        for(int i = 1; i <= n; i++)if(col[i] == 2)cntr++;
        int need = (k + 1) / 2;
        int c = -1;
        if(cntr >= need)c = 2;
        else if(n - cntr >= need)c = 1;
        if(c == -1)goto fin;
        puts("1");
        cntr = 0;
        for(int i = 1; i <= n && cntr < (k + 1) / 2; i++)
            if(col[i] == c)printf("%d ", i), cntr++;
        puts("");
        return 0;
    }
    fin:;
    dfss(1, 1);
    puts("1");
    vector<int>o, e;
    for(int i = 1; i <= n; i++)if(d[i]&1)o.push_back(i);else e.push_back(i);
    if(o.size() >= (k + 1) / 2){
        for(int i = 0; i < (k + 1) / 2; i++)
            printf("%d ", o[i]);
        puts("");
    }else{
        for(int i = 0; i < (k + 1) / 2; i++)
            printf("%d ", e[i]);
        puts("");
    }
    return 0;
}


                                        /******SHOW US THE BEST YOU CAN DO******/

#include<bits/stdc++.h>

using namespace std;

#define ll long long int

ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}

const int N = 1e5 + 10;

vector<int>ad[N], path;
int vis[N], col[N], n, m, k, f;
void dfs(int v, int c){
    col[v] = c;
    for(auto u : ad[v]){
        if(col[u] && col[u] == c){
            f = 1;
            return;
        }
        if(!col[u])
            dfs(u, 3 - c);
    }
}

void dfs(int v){
    vis[v] = 1;
    path.push_back(v);
    for(auto u : ad[v]){
        if(vis[u] == 1){
            vector<int>t;
            int idx = (int)path.size() - 1;
            while(path[idx] != u)t.push_back(path[idx--]);
            t.push_back(u);
            if((int)t.size() <= k && (int)t.size() >= 3){
                printf("%d\n%d\n", 2, (int)t.size());
                for(auto u : t)printf("%d ", u);
                puts("");
                exit(0);
            }
        }else if(vis[u] == 0)
            dfs(u);
    }
    vis[v] = 2;
    path.pop_back();
}

int myceil(int a, int b){
    return (a + b - 1) / b;
}

int main(){
    //freopen("output.in","r",stdin);
    //freopen("output.txt","w",stdout);
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 1; i <= m; i++){
        int x, y;
        scanf("%d%d", &x, &y);
        ad[x].push_back(y);
        ad[y].push_back(x);
    }
    dfs(1, 1);
    if(!f){
        int cntr = 0;
        for(int i = 1; i <= n; i++)if(col[i] == 2)cntr++;
        int need = myceil(n, 2);
        int c = -1;
        if(cntr >= need)c = 2;
        else if(n - cntr >= need)c = 1;
        if(c == -1)goto fin;
        puts("1");
        cntr = 0;
        for(int i = 1; i <= n && cntr < need; i++)
            if(col[i] == c){
                printf("%d ", i);
                cntr++;
            }
        puts("");
        return 0;
    }
    fin:;
    dfs(1);

    return 0;
}


                                        /******SHOW US THE BEST YOU CAN DO******/

#include<bits/stdc++.h>

using namespace std;

#define ll long long int

ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}

const int N = 1e5 + 10;

vector<int>ad[N], ans, path;
int vis[N], col[N], n, m, k, f;
void dfs(int v, int c){
    col[v] = c;
    for(auto u : ad[v]){
        if(col[u] == c){
            f = 1;
            return;
        }
        if(!col[u])
            dfs(u, 3 - c);
    }
}

void dfs(int v){
    vis[v] = 1;
    path.push_back(v);
    for(auto u : ad[v]){
        if(vis[u] == 1){
            vector<int>t;
            int idx = (int)path.size() - 1;
            while(path[idx] != u)t.push_back(path[idx--]);
            t.push_back(u);
            if((int)t.size() <= k && (int)t.size() >= 3 && ans.size() == 0){
                ans = t;
            }
        }else if(vis[u] == 0)
            dfs(u);
    }
    vis[v] = 2;
    path.pop_back();
}

int myceil(int a, int b){
    return (a + b - 1) / b;
}

int main(){
    //freopen("output.in","r",stdin);
    //freopen("output.txt","w",stdout);
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 1; i <= m; i++){
        int x, y;
        scanf("%d%d", &x, &y);
        ad[x].push_back(y);
        ad[y].push_back(x);
    }
    dfs(1, 1);
    if(!f){
        int cntr = 0;
        for(int i = 1; i <= n; i++)if(col[i] == 2)cntr++;
        int need = myceil(n, 2);
        int c = -1;
        if(cntr == need)c = 2;
        else if(n - cntr == need)c = 1;
        if(c == -1)goto fin;
        puts("1");
        for(int i = 1; i <= n; i++)
            if(col[i] == c)printf("%d ", i);
        puts("");
        return 0;
    }
    fin:;
    dfs(1);
    printf("%d\n%d\n", 2, (int)ans.size());
    for(auto u : ans)printf("%d ", u);
    puts("");
    return 0;
}


///বিসমিল্লাহির_রহমানির_রহীম
#include<bits/stdc++.h>
#define     pie                          acos(-1.0)
#define     N                            2000015
#define     eps                          1e-9
#define     ff                           first
#define     ss                           second
#define     nl                           '\n'
#define     mod                          1000000007
#define     sp                           ' '
#define     CLR(a)                       memset(a,0,sizeof(a))
#define     SET(a)                       memset(a,-1,sizeof(a))
#define     all(x)                       x.begin(),x.end()
#define     allr(x)                      x.rbegin(),x.rend()
#define     sz(x)                        (int)(x).size()
#define     Fast_Read                    ios_base::sync_with_stdio(false); cin.tie(nullptr);  cout.tie(nullptr);
#define     Precision(x)                 cout.setf(ios::fixed); cout.precision(x);
#define     bug                          cout<<"debug"<<nl;
using namespace std;
int dx[]={0,0,1,-1,-1,-1,1,1};
int dy[]={1,-1,0,0,-1,1,1,-1};
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
template < class T> inline T biton(T n,T pos){return n |((T)1<<pos);}
template < class T> inline T bitoff(T n,T pos){return n & ~((T)1<<pos);}
template < class T> inline T ison(T n,T pos){return (bool)(n & ((T)1<<pos));}
template < class T> inline T gcd(T a, T b){while(b){a%=b;swap(a,b);}return a;}
inline int nxt(){int aaa;scanf("%d",&aaa);return aaa;}
inline ll lxt(){ll aaa;scanf("%lld",&aaa);return aaa;}
inline double dxt(){double aaa;scanf("%lf",&aaa);return aaa;}
template <class T> inline T bigmod(T p,T e,T m){T ret = 1;
for(; e > 0; e >>= 1){
    if(e & 1) ret = (ret * p) % m;p = (p * p) % m;
} return (T)ret;}
#ifdef obaydullah
     #define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template < typename Arg1 >
    void __f(const char* name, Arg1&& arg1){
        cerr << name << " is " << arg1 << std::endl;
    }
    template < typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names+1, ',');
        cerr.write(names, comma - names) << " is " << arg1 <<" | ";
        __f(comma+1, args...);
    }
#else
    #define debug(...)
#endif
///******************************************START******************************************
template<class T>
istream& operator>>(istream& is, vector<T>& input){
    for(T& in:input) is >> in; return is;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T> &input){
    bool isFirst=true;for(T out:input){if(isFirst){os<<out;isFirst=false;}else os<<" "<<out;}return os;
}
const int inf = INT_MAX/3;
vector<vector<int> > adj;
vector<bool> vis;vector<int> depth, hello;
void addEdge(int u, int v){
    adj[u].emplace_back(v);
    adj[v].emplace_back(u);
}
int mn = INT_MAX/3, here = -1,another = -1;
void dfs(int node, int& dp,int dep = 0,int par = -1){
    vis[node] = true;
    depth[node] = dep;
    dp++;
    hello[node] = dp;
    for(int v:adj[node]){
        if(v == par) continue; ///Ignore parent
        if(!vis[v]){        ///Tree edge
            dfs(v,dp,dep+1,node);
        }
        else{
            if(abs(hello[node]-hello[v])<mn) here = v, mn = abs(hello[node]-hello[v]), another = node;
        }
    }
}
int n, m, x;
vector<int> odd, even;
void bfs(){
    queue<int> q; q.push(1);
    vector<int> visited(n+1,-1);
    visited[1] = 0; even.push_back(1);
    while(!q.empty()){
        int u = q.front(); q.pop();
        for(int v:adj[u]){
            if(visited[v]==-1){
                visited[v] = visited[u]+1;
                if(visited[v]&1) odd.push_back(v);
                else even.push_back(v);
                q.push(v);
            }
        }
    }
}
void solve(){
    n=nxt(), m=nxt(), x=nxt();
    adj.resize(n+1); vis.assign(n+1,0);
    depth.assign(n+1,0); hello.assign(n+1,0);
    for(int i=0;i<m;i++){
        int u=nxt(), v=nxt();
        addEdge(u,v);
    }
    int dp = 0;
    dfs(1, dp);
    vector<int> ans;
    int go = here;
    int cnt = 0;
    while(go!=another){
        ans.push_back(go);
        bool ok = true;
        for(int v:adj[go]){
            if(hello[v] == hello[go]+1){
                ok=false;
                go = v;
                break;
            }
        }
        assert(!ok);
    }
    if(another !=-1) ans.push_back(another);
    if(sz(ans)>0 && sz(ans)<=x){
        cout<<2<<nl;
        cout<<sz(ans)<<nl;
        cout<<ans<<nl;
        return;
    }
    bfs();
    if(sz(odd)>=((x+1)/2)){
        cout<<1<<nl;
        for(int i=0;i<((x+1)/2);i++) cout<<odd[i]<<" ";
        cout<<nl; return;
    }
    if(sz(even)>=((x+1)/2)){
        cout<<1<<nl;
        for(int i = 0;i<((x+1)/2);i++) cout<<even[i]<<" ";
        cout<<nl; return;
    }
    assert(here!=-1);
    assert(mn+1<=x);
    cout<<2<<nl;
    cout<<sz(ans)<<nl;
    cout<<ans<<nl;

}
int main()
{
    //Fast_Read
    Precision(10)
#ifdef obaydullah
    double start_time = clock();
    ///freopen ("output.txt","w",stdout);
    ///freopen ("input.txt","r",stdin);
#endif
    int tc=1;
    while(tc--)
    {
        solve();
    }
#ifdef obaydullah
    double end_time = clock();
    cerr<<"Time = "<<fixed<<setprecision(10)<<(end_time - start_time) / CLOCKS_PER_SEC<<'\n';
#endif

    return 0;
}


///বিসমিল্লাহির_রহমানির_রহীম
#include<bits/stdc++.h>
#define     pie                          acos(-1.0)
#define     N                            2000015
#define     eps                          1e-9
#define     ff                           first
#define     ss                           second
#define     nl                           '\n'
#define     mod                          1000000007
#define     sp                           ' '
#define     CLR(a)                       memset(a,0,sizeof(a))
#define     SET(a)                       memset(a,-1,sizeof(a))
#define     all(x)                       x.begin(),x.end()
#define     allr(x)                      x.rbegin(),x.rend()
#define     sz(x)                        (int)(x).size()
#define     Fast_Read                    ios_base::sync_with_stdio(false); cin.tie(nullptr);  cout.tie(nullptr);
#define     Precision(x)                 cout.setf(ios::fixed); cout.precision(x);
#define     bug                          cout<<"debug"<<nl;
using namespace std;
int dx[]={0,0,1,-1,-1,-1,1,1};
int dy[]={1,-1,0,0,-1,1,1,-1};
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
template < class T> inline T biton(T n,T pos){return n |((T)1<<pos);}
template < class T> inline T bitoff(T n,T pos){return n & ~((T)1<<pos);}
template < class T> inline T ison(T n,T pos){return (bool)(n & ((T)1<<pos));}
template < class T> inline T gcd(T a, T b){while(b){a%=b;swap(a,b);}return a;}
inline int nxt(){int aaa;scanf("%d",&aaa);return aaa;}
inline ll lxt(){ll aaa;scanf("%lld",&aaa);return aaa;}
inline double dxt(){double aaa;scanf("%lf",&aaa);return aaa;}
template <class T> inline T bigmod(T p,T e,T m){T ret = 1;
for(; e > 0; e >>= 1){
    if(e & 1) ret = (ret * p) % m;p = (p * p) % m;
} return (T)ret;}
#ifdef obaydullah
     #define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template < typename Arg1 >
    void __f(const char* name, Arg1&& arg1){
        cerr << name << " is " << arg1 << std::endl;
    }
    template < typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names+1, ',');
        cerr.write(names, comma - names) << " is " << arg1 <<" | ";
        __f(comma+1, args...);
    }
#else
    #define debug(...)
#endif
///******************************************START******************************************
template<class T>
istream& operator>>(istream& is, vector<T>& input){
    for(T& in:input) is >> in; return is;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T> &input){
    bool isFirst=true;for(T out:input){if(isFirst){os<<out;isFirst=false;}else os<<" "<<out;}return os;
}
const int inf = INT_MAX/3;
vector<vector<int> > adj;
vector<bool> vis;vector<int> depth, hello;
void addEdge(int u, int v){
    adj[u].emplace_back(v);
    adj[v].emplace_back(u);
}
int mn = INT_MAX/3, here = -1,another = -1;
void dfs(int node, int& dp,int dep = 0,int par = -1){
    vis[node] = true;
    depth[node] = dep;
    dp++;
    hello[node] = dp;
    for(int v:adj[node]){
        if(v == par) continue; ///Ignore parent
        if(!vis[v]){        ///Tree edge
            dfs(v,dp,dep+1,node);
        }
        else{
            if(abs(depth[node]-depth[v])<mn) here = v, mn = abs(depth[node]-depth[v]), another = node;
        }
    }
}
int n, m, x;
vector<int> odd, even;
void bfs(){
    queue<int> q; q.push(1);
    vector<int> visited(n+1,-1);
    visited[1] = 0; even.push_back(1);
    while(!q.empty()){
        int u = q.front(); q.pop();
        for(int v:adj[u]){
            if(visited[v]==-1){
                visited[v] = visited[u]+1;
                if(visited[v]&1) odd.push_back(v);
                else even.push_back(v);
                q.push(v);
            }
        }
    }
}
void solve(){
    n=nxt(), m=nxt(), x=nxt();
    adj.resize(n+1); vis.assign(n+1,0);
    depth.assign(n+1,0); hello.assign(n+1,0);
    for(int i=0;i<m;i++){
        int u=nxt(), v=nxt();
        addEdge(u,v);
    }
    int dp = 0;
    dfs(1, dp);
    vector<int> ans;
    ans.push_back(another);
    if(ans.back()==-1) ans.pop_back();
    int go = another;
    while(go!=here && go!=-1){
        for(int v:adj[go]){
            if(hello[v] == hello[go]-1){
                ans.push_back(v);
                go = v; break;
            }
        }
    }
    if(sz(ans)>0 && sz(ans)<=x){
        cout<<2<<nl;
        cout<<sz(ans)<<nl;
        cout<<ans<<nl;
        return;
    }
    bfs();
    if(sz(odd)>=((x+1)/2)){
        cout<<1<<nl;
        for(int i=0;i<((x+1)/2);i++) cout<<odd[i]<<" ";
        cout<<nl; return;
    }
    if(sz(even)>=((x+1)/2)){
        cout<<1<<nl;
        for(int i = 0;i<((x+1)/2);i++) cout<<even[i]<<" ";
        cout<<nl; return;
    }
    assert(here!=-1);
    assert(mn+1<=x);
    cout<<2<<nl;
    cout<<sz(ans)<<nl;
    cout<<ans<<nl;

}
int main()
{
    //Fast_Read
    Precision(10)
#ifdef obaydullah
    double start_time = clock();
    ///freopen ("output.txt","w",stdout);
    ///freopen ("input.txt","r",stdin);
#endif
    int tc=1;
    while(tc--)
    {
        solve();
    }
#ifdef obaydullah
    double end_time = clock();
    cerr<<"Time = "<<fixed<<setprecision(10)<<(end_time - start_time) / CLOCKS_PER_SEC<<'\n';
#endif

    return 0;
}


///বিসমিল্লাহির_রহমানির_রহীম
#include<bits/stdc++.h>
#define     pie                          acos(-1.0)
#define     N                            2000015
#define     eps                          1e-9
#define     ff                           first
#define     ss                           second
#define     nl                           '\n'
#define     mod                          1000000007
#define     sp                           ' '
#define     CLR(a)                       memset(a,0,sizeof(a))
#define     SET(a)                       memset(a,-1,sizeof(a))
#define     all(x)                       x.begin(),x.end()
#define     allr(x)                      x.rbegin(),x.rend()
#define     sz(x)                        (int)(x).size()
#define     Fast_Read                    ios_base::sync_with_stdio(false); cin.tie(nullptr);  cout.tie(nullptr);
#define     Precision(x)                 cout.setf(ios::fixed); cout.precision(x);
#define     bug                          cout<<"debug"<<nl;
using namespace std;
int dx[]={0,0,1,-1,-1,-1,1,1};
int dy[]={1,-1,0,0,-1,1,1,-1};
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
template < class T> inline T biton(T n,T pos){return n |((T)1<<pos);}
template < class T> inline T bitoff(T n,T pos){return n & ~((T)1<<pos);}
template < class T> inline T ison(T n,T pos){return (bool)(n & ((T)1<<pos));}
template < class T> inline T gcd(T a, T b){while(b){a%=b;swap(a,b);}return a;}
inline int nxt(){int aaa;scanf("%d",&aaa);return aaa;}
inline ll lxt(){ll aaa;scanf("%lld",&aaa);return aaa;}
inline double dxt(){double aaa;scanf("%lf",&aaa);return aaa;}
template <class T> inline T bigmod(T p,T e,T m){T ret = 1;
for(; e > 0; e >>= 1){
    if(e & 1) ret = (ret * p) % m;p = (p * p) % m;
} return (T)ret;}
#ifdef obaydullah
     #define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template < typename Arg1 >
    void __f(const char* name, Arg1&& arg1){
        cerr << name << " is " << arg1 << std::endl;
    }
    template < typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names+1, ',');
        cerr.write(names, comma - names) << " is " << arg1 <<" | ";
        __f(comma+1, args...);
    }
#else
    #define debug(...)
#endif
///******************************************START******************************************
template<class T>
istream& operator>>(istream& is, vector<T>& input){
    for(T& in:input) is >> in; return is;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T> &input){
    bool isFirst=true;for(T out:input){if(isFirst){os<<out;isFirst=false;}else os<<" "<<out;}return os;
}
const int inf = INT_MAX/3;
vector<vector<int> > adj;
vector<bool> vis;vector<int> depth, hello;
void addEdge(int u, int v){
    adj[u].emplace_back(v);
    adj[v].emplace_back(u);
}
int mn = INT_MAX/3, here = -1,another = -1;
void dfs(int node, int& dp,int dep = 0,int par = -1){
    vis[node] = true;
    depth[node] = dep;
    dp++;
    hello[node] = dp;
    for(int v:adj[node]){
        if(v == par) continue; ///Ignore parent
        if(!vis[v]){        ///Tree edge
            dfs(v,dp,dep+1,node);
        }
        else{
            if(abs(depth[node]-depth[v])<mn) here = v, mn = abs(depth[node]-depth[v]), another = node;
        }
    }
}
int n, m, x;
vector<int> odd, even;
void bfs(){
    queue<int> q; q.push(1);
    vector<int> visited(n+1,-1);
    visited[1] = 0; even.push_back(1);
    while(!q.empty()){
        int u = q.front(); q.pop();
        for(int v:adj[u]){
            if(visited[v]==-1){
                visited[v] = visited[u]+1;
                if(visited[v]&1) odd.push_back(v);
                else even.push_back(v);
                q.push(v);
            }
        }
    }
}
void solve(){
    n=nxt(), m=nxt(), x=nxt();
    adj.resize(n+1); vis.assign(n+1,0);
    depth.assign(n+1,0); hello.assign(n+1,0);
    for(int i=0;i<m;i++){
        int u=nxt(), v=nxt();
        addEdge(u,v);
    }
    int dp = 0;
    dfs(1, dp);
    vector<int> ans;
    ans.push_back(another);
    if(ans.back()==-1) ans.pop_back();
    int go = another;
    int cnt = 0;
    while(go!=here){
        for(int v:adj[go]){
            if(hello[v] == hello[go]-1){
                ans.push_back(v);
                go = v; break;
            }
        }
        cnt++;
        assert(cnt<=(int)n);
    }
    if(sz(ans)>0 && sz(ans)<=x){
        cout<<2<<nl;
        cout<<sz(ans)<<nl;
        cout<<ans<<nl;
        return;
    }
    bfs();
    if(sz(odd)>=((x+1)/2)){
        cout<<1<<nl;
        for(int i=0;i<((x+1)/2);i++) cout<<odd[i]<<" ";
        cout<<nl; return;
    }
    if(sz(even)>=((x+1)/2)){
        cout<<1<<nl;
        for(int i = 0;i<((x+1)/2);i++) cout<<even[i]<<" ";
        cout<<nl; return;
    }
    assert(here!=-1);
    assert(mn+1<=x);
    cout<<2<<nl;
    cout<<sz(ans)<<nl;
    cout<<ans<<nl;

}
int main()
{
    //Fast_Read
    Precision(10)
#ifdef obaydullah
    double start_time = clock();
    ///freopen ("output.txt","w",stdout);
    ///freopen ("input.txt","r",stdin);
#endif
    int tc=1;
    while(tc--)
    {
        solve();
    }
#ifdef obaydullah
    double end_time = clock();
    cerr<<"Time = "<<fixed<<setprecision(10)<<(end_time - start_time) / CLOCKS_PER_SEC<<'\n';
#endif

    return 0;
}


///বিসমিল্লাহির_রহমানির_রহীম
#include<bits/stdc++.h>
#define     pie                          acos(-1.0)
#define     N                            2000015
#define     eps                          1e-9
#define     ff                           first
#define     ss                           second
#define     nl                           '\n'
#define     mod                          1000000007
#define     sp                           ' '
#define     CLR(a)                       memset(a,0,sizeof(a))
#define     SET(a)                       memset(a,-1,sizeof(a))
#define     all(x)                       x.begin(),x.end()
#define     allr(x)                      x.rbegin(),x.rend()
#define     sz(x)                        (int)(x).size()
#define     Fast_Read                    ios_base::sync_with_stdio(false); cin.tie(nullptr);  cout.tie(nullptr);
#define     Precision(x)                 cout.setf(ios::fixed); cout.precision(x);
#define     bug                          cout<<"debug"<<nl;
using namespace std;
int dx[]={0,0,1,-1,-1,-1,1,1};
int dy[]={1,-1,0,0,-1,1,1,-1};
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
template < class T> inline T biton(T n,T pos){return n |((T)1<<pos);}
template < class T> inline T bitoff(T n,T pos){return n & ~((T)1<<pos);}
template < class T> inline T ison(T n,T pos){return (bool)(n & ((T)1<<pos));}
template < class T> inline T gcd(T a, T b){while(b){a%=b;swap(a,b);}return a;}
inline int nxt(){int aaa;scanf("%d",&aaa);return aaa;}
inline ll lxt(){ll aaa;scanf("%lld",&aaa);return aaa;}
inline double dxt(){double aaa;scanf("%lf",&aaa);return aaa;}
template <class T> inline T bigmod(T p,T e,T m){T ret = 1;
for(; e > 0; e >>= 1){
    if(e & 1) ret = (ret * p) % m;p = (p * p) % m;
} return (T)ret;}
#ifdef obaydullah
     #define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template < typename Arg1 >
    void __f(const char* name, Arg1&& arg1){
        cerr << name << " is " << arg1 << std::endl;
    }
    template < typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names+1, ',');
        cerr.write(names, comma - names) << " is " << arg1 <<" | ";
        __f(comma+1, args...);
    }
#else
    #define debug(...)
#endif
///******************************************START******************************************
template<class T>
istream& operator>>(istream& is, vector<T>& input){
    for(T& in:input) is >> in; return is;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T> &input){
    bool isFirst=true;for(T out:input){if(isFirst){os<<out;isFirst=false;}else os<<" "<<out;}return os;
}
const int inf = INT_MAX/3;
vector<vector<int> > adj;
vector<bool> vis;vector<int> depth, hello;
void addEdge(int u, int v){
    adj[u].emplace_back(v);
    adj[v].emplace_back(u);
}
int mn = INT_MAX/3, here = -1,another = -1;
void dfs(int node, int& dp,int dep = 0,int par = -1){
    vis[node] = true;
    depth[node] = dep;
    dp++;
    hello[node] = dp;
    for(int v:adj[node]){
        if(v == par) continue; ///Ignore parent
        if(!vis[v]){        ///Tree edge
            dfs(v,dp,dep+1,node);
        }
        else{
            if(abs(depth[node]-depth[v])<mn) here = v, mn = abs(depth[node]-depth[v]), another = node;
        }
    }
}
int n, m, x;
vector<int> odd, even;
void bfs(){
    queue<int> q; q.push(1);
    vector<int> visited(n+1,-1);
    visited[1] = 0; even.push_back(1);
    while(!q.empty()){
        int u = q.front(); q.pop();
        for(int v:adj[u]){
            if(visited[v]==-1){
                visited[v] = visited[u]+1;
                if(visited[v]&1) odd.push_back(v);
                else even.push_back(v);
                q.push(v);
            }
        }
    }
}
void solve(){
    n=nxt(), m=nxt(), x=nxt();
    adj.resize(n+1); vis.assign(n+1,0);
    depth.assign(n+1,0); hello.assign(n+1,0);
    for(int i=0;i<m;i++){
        int u=nxt(), v=nxt();
        addEdge(u,v);
    }
    int dp = 0;
    dfs(1, dp);
    vector<int> ans;
    ans.push_back(another);
    int go = another;
    while(go!=here && go!=-1){
        for(int v:adj[go]){
            if(hello[v] == hello[go]-1){
                ans.push_back(v);
                go = v; break;
            }
        }
    }
    if(sz(ans)>0 && sz(ans)<=x){
        cout<<2<<nl;
        cout<<sz(ans)<<nl;
        cout<<ans<<nl;
        return;
    }
    bfs();
    if(sz(odd)>=((x+1)/2)){
        cout<<1<<nl;
        for(int i=0;i<((x+1)/2);i++) cout<<odd[i]<<" ";
        cout<<nl; return;
    }
    if(sz(even)>=((x+1)/2)){
        cout<<1<<nl;
        for(int i = 0;i<((x+1)/2);i++) cout<<even[i]<<" ";
        cout<<nl; return;
    }
    assert(here!=-1);
    assert(mn+1<=x);
    cout<<2<<nl;
    cout<<sz(ans)<<nl;
    cout<<ans<<nl;

}
int main()
{
    //Fast_Read
    Precision(10)
#ifdef obaydullah
    double start_time = clock();
    ///freopen ("output.txt","w",stdout);
    ///freopen ("input.txt","r",stdin);
#endif
    int tc=1;
    while(tc--)
    {
        solve();
    }
#ifdef obaydullah
    double end_time = clock();
    cerr<<"Time = "<<fixed<<setprecision(10)<<(end_time - start_time) / CLOCKS_PER_SEC<<'\n';
#endif

    return 0;
}


///বিসমিল্লাহির_রহমানির_রহীম
#include<bits/stdc++.h>
#define     pie                          acos(-1.0)
#define     N                            2000015
#define     eps                          1e-9
#define     ff                           first
#define     ss                           second
#define     nl                           '\n'
#define     mod                          1000000007
#define     sp                           ' '
#define     CLR(a)                       memset(a,0,sizeof(a))
#define     SET(a)                       memset(a,-1,sizeof(a))
#define     all(x)                       x.begin(),x.end()
#define     allr(x)                      x.rbegin(),x.rend()
#define     sz(x)                        (int)(x).size()
#define     Fast_Read                    ios_base::sync_with_stdio(false); cin.tie(nullptr);  cout.tie(nullptr);
#define     Precision(x)                 cout.setf(ios::fixed); cout.precision(x);
#define     bug                          cout<<"debug"<<nl;
using namespace std;
int dx[]={0,0,1,-1,-1,-1,1,1};
int dy[]={1,-1,0,0,-1,1,1,-1};
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
template < class T> inline T biton(T n,T pos){return n |((T)1<<pos);}
template < class T> inline T bitoff(T n,T pos){return n & ~((T)1<<pos);}
template < class T> inline T ison(T n,T pos){return (bool)(n & ((T)1<<pos));}
template < class T> inline T gcd(T a, T b){while(b){a%=b;swap(a,b);}return a;}
inline int nxt(){int aaa;scanf("%d",&aaa);return aaa;}
inline ll lxt(){ll aaa;scanf("%lld",&aaa);return aaa;}
inline double dxt(){double aaa;scanf("%lf",&aaa);return aaa;}
template <class T> inline T bigmod(T p,T e,T m){T ret = 1;
for(; e > 0; e >>= 1){
    if(e & 1) ret = (ret * p) % m;p = (p * p) % m;
} return (T)ret;}
#ifdef obaydullah
     #define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template < typename Arg1 >
    void __f(const char* name, Arg1&& arg1){
        cerr << name << " is " << arg1 << std::endl;
    }
    template < typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names+1, ',');
        cerr.write(names, comma - names) << " is " << arg1 <<" | ";
        __f(comma+1, args...);
    }
#else
    #define debug(...)
#endif
///******************************************START******************************************
template<class T>
istream& operator>>(istream& is, vector<T>& input){
    for(T& in:input) is >> in; return is;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T> &input){
    bool isFirst=true;for(T out:input){if(isFirst){os<<out;isFirst=false;}else os<<" "<<out;}return os;
}
const int inf = INT_MAX/3;
vector<vector<int> > adj;
vector<bool> vis;vector<int> depth, hello;
void addEdge(int u, int v){
    adj[u].emplace_back(v);
    adj[v].emplace_back(u);
}
int mn = INT_MAX/3, here = -1,another = -1;
void dfs(int node, int& dp,int dep = 0,int par = -1){
    vis[node] = true;
    depth[node] = dep;
    dp++;
    hello[node] = dp;
    for(int v:adj[node]){
        if(v == par) continue; ///Ignore parent
        if(!vis[v]){        ///Tree edge
            dfs(v,dp,dep+1,node);
        }
        else{
            if(abs(depth[node]-depth[v])<mn) here = v, mn = abs(depth[node]-depth[v]), another = node;
        }
    }
}
int n, m, x;
vector<int> odd, even;
void bfs(){
    queue<int> q; q.push(1);
    vector<int> visited(n+1,-1);
    visited[1] = 0; even.push_back(1);
    while(!q.empty()){
        int u = q.front(); q.pop();
        for(int v:adj[u]){
            if(visited[v]==-1){
                visited[v] = visited[u]+1;
                if(visited[v]&1) odd.push_back(v);
                else even.push_back(v);
                q.push(v);
            }
        }
    }
}
void solve(){
    n=nxt(), m=nxt(), x=nxt();
    adj.resize(n+1); vis.assign(n+1,0);
    depth.assign(n+1,0); hello.assign(n+1,0);
    for(int i=0;i<m;i++){
        int u=nxt(), v=nxt();
        addEdge(u,v);
    }
    bfs();
    if(sz(odd)>=((x+1)/2)){
        cout<<1<<nl;
        for(int i=0;i<((x+1)/2);i++) cout<<odd[i]<<" ";
        cout<<nl; return;
    }
    if(sz(even)>=((x+1)/2)){
        cout<<1<<nl;
        for(int i = 0;i<((x+1)/2);i++) cout<<even[i]<<" ";
        cout<<nl; return;
    }
    int dp = 0;
    dfs(1, dp);
    assert(here!=-1);
    assert(mn+1<=x);
    vector<int> ans;
    ans.push_back(another);
    int go = another;
    while(go!=here){
        for(int v:adj[go]){
            if(hello[v] == hello[go]-1){
                ans.push_back(v);
                go = v; break;
            }
        }
    }
    cout<<2<<nl;
    cout<<sz(ans)<<nl;
    cout<<ans<<nl;

}
int main()
{
    //Fast_Read
    Precision(10)
#ifdef obaydullah
    double start_time = clock();
    ///freopen ("output.txt","w",stdout);
    ///freopen ("input.txt","r",stdin);
#endif
    int tc=1;
    while(tc--)
    {
        solve();
    }
#ifdef obaydullah
    double end_time = clock();
    cerr<<"Time = "<<fixed<<setprecision(10)<<(end_time - start_time) / CLOCKS_PER_SEC<<'\n';
#endif

    return 0;
}


///বিসমিল্লাহির_রহমানির_রহীম
#include<bits/stdc++.h>
#define     pie                          acos(-1.0)
#define     N                            2000015
#define     eps                          1e-9
#define     ff                           first
#define     ss                           second
#define     nl                           '\n'
#define     mod                          1000000007
#define     sp                           ' '
#define     CLR(a)                       memset(a,0,sizeof(a))
#define     SET(a)                       memset(a,-1,sizeof(a))
#define     all(x)                       x.begin(),x.end()
#define     allr(x)                      x.rbegin(),x.rend()
#define     sz(x)                        (int)(x).size()
#define     Fast_Read                    ios_base::sync_with_stdio(false); cin.tie(nullptr);  cout.tie(nullptr);
#define     Precision(x)                 cout.setf(ios::fixed); cout.precision(x);
#define     bug                          cout<<"debug"<<nl;
using namespace std;
int dx[]={0,0,1,-1,-1,-1,1,1};
int dy[]={1,-1,0,0,-1,1,1,-1};
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
template < class T> inline T biton(T n,T pos){return n |((T)1<<pos);}
template < class T> inline T bitoff(T n,T pos){return n & ~((T)1<<pos);}
template < class T> inline T ison(T n,T pos){return (bool)(n & ((T)1<<pos));}
template < class T> inline T gcd(T a, T b){while(b){a%=b;swap(a,b);}return a;}
inline int nxt(){int aaa;scanf("%d",&aaa);return aaa;}
inline ll lxt(){ll aaa;scanf("%lld",&aaa);return aaa;}
inline double dxt(){double aaa;scanf("%lf",&aaa);return aaa;}
template <class T> inline T bigmod(T p,T e,T m){T ret = 1;
for(; e > 0; e >>= 1){
    if(e & 1) ret = (ret * p) % m;p = (p * p) % m;
} return (T)ret;}
#ifdef obaydullah
     #define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template < typename Arg1 >
    void __f(const char* name, Arg1&& arg1){
        cerr << name << " is " << arg1 << std::endl;
    }
    template < typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names+1, ',');
        cerr.write(names, comma - names) << " is " << arg1 <<" | ";
        __f(comma+1, args...);
    }
#else
    #define debug(...)
#endif
///******************************************START******************************************
template<class T>
istream& operator>>(istream& is, vector<T>& input){
    for(T& in:input) is >> in; return is;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T> &input){
    bool isFirst=true;for(T out:input){if(isFirst){os<<out;isFirst=false;}else os<<" "<<out;}return os;
}
const int inf = INT_MAX/3;
vector<vector<int> > adj;
vector<bool> vis;vector<int> depth, hello;
void addEdge(int u, int v){
    adj[u].emplace_back(v);
    adj[v].emplace_back(u);
}
int mn = INT_MAX/3, here = -1,another = -1;
void dfs(int node, int& dp,int dep = 0,int par = -1){
    vis[node] = true;
    depth[node] = dep;
    dp++;
    hello[node] = dp;
    for(int v:adj[node]){
        if(v == par) continue; ///Ignore parent
        if(!vis[v]){        ///Tree edge
            dfs(v,dp,dep+1,node);
        }
        else{
            if(abs(hello[node]-hello[v])<mn) here = v, mn = abs(hello[node]-hello[v]), another = node;
        }
    }
}
int n, m, x;
vector<int> odd, even;
void bfs(){
    queue<int> q; q.push(1);
    vector<int> visited(n+1,-1);
    visited[1] = 0; even.push_back(1);
    while(!q.empty()){
        int u = q.front(); q.pop();
        for(int v:adj[u]){
            if(visited[v]==-1){
                visited[v] = visited[u]+1;
                if(visited[v]&1) odd.push_back(v);
                else even.push_back(v);
                q.push(v);
            }
        }
    }
}
void solve(){
    n=nxt(), m=nxt(), x=nxt();
    adj.resize(n+1); vis.assign(n+1,0);
    depth.assign(n+1,0); hello.assign(n+1,0);
    for(int i=0;i<m;i++){
        int u=nxt(), v=nxt();
        addEdge(u,v);
    }
    int dp = 0;
    dfs(1, dp);
    vector<int> ans;
    int go = here;
    int cnt = 0;
    while(go!=another){
        ans.push_back(go);
        bool ok = true;
        for(int v:adj[go]){
            if(hello[v] == hello[go]+1){
                ok=false;
                go = v;
                break;
            }
        }
        if(ok){
            another = -1; ans.clear();
        }
    }
    if(another !=-1) ans.push_back(another);
    if(sz(ans)>0 && sz(ans)<=x){
        cout<<2<<nl;
        cout<<sz(ans)<<nl;
        cout<<ans<<nl;
        return;
    }
    bfs();
    if(sz(odd)>=((x+1)/2)){
        cout<<1<<nl;
        for(int i=0;i<((x+1)/2);i++) cout<<odd[i]<<" ";
        cout<<nl; return;
    }
    if(sz(even)>=((x+1)/2)){
        cout<<1<<nl;
        for(int i = 0;i<((x+1)/2);i++) cout<<even[i]<<" ";
        cout<<nl; return;
    }
    assert(here!=-1);
    assert(mn+1<=x);
    cout<<2<<nl;
    cout<<sz(ans)<<nl;
    cout<<ans<<nl;

}
int main()
{
    //Fast_Read
    Precision(10)
#ifdef obaydullah
    double start_time = clock();
    ///freopen ("output.txt","w",stdout);
    ///freopen ("input.txt","r",stdin);
#endif
    int tc=1;
    while(tc--)
    {
        solve();
    }
#ifdef obaydullah
    double end_time = clock();
    cerr<<"Time = "<<fixed<<setprecision(10)<<(end_time - start_time) / CLOCKS_PER_SEC<<'\n';
#endif

    return 0;
}


///বিসমিল্লাহির_রহমানির_রহীম
#include<bits/stdc++.h>
#define     pie                          acos(-1.0)
#define     N                            2000015
#define     eps                          1e-9
#define     ff                           first
#define     ss                           second
#define     nl                           '\n'
#define     mod                          1000000007
#define     sp                           ' '
#define     CLR(a)                       memset(a,0,sizeof(a))
#define     SET(a)                       memset(a,-1,sizeof(a))
#define     all(x)                       x.begin(),x.end()
#define     allr(x)                      x.rbegin(),x.rend()
#define     sz(x)                        (int)(x).size()
#define     Fast_Read                    ios_base::sync_with_stdio(false); cin.tie(nullptr);  cout.tie(nullptr);
#define     Precision(x)                 cout.setf(ios::fixed); cout.precision(x);
#define     bug                          cout<<"debug"<<nl;
using namespace std;
int dx[]={0,0,1,-1,-1,-1,1,1};
int dy[]={1,-1,0,0,-1,1,1,-1};
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
template < class T> inline T biton(T n,T pos){return n |((T)1<<pos);}
template < class T> inline T bitoff(T n,T pos){return n & ~((T)1<<pos);}
template < class T> inline T ison(T n,T pos){return (bool)(n & ((T)1<<pos));}
template < class T> inline T gcd(T a, T b){while(b){a%=b;swap(a,b);}return a;}
inline int nxt(){int aaa;scanf("%d",&aaa);return aaa;}
inline ll lxt(){ll aaa;scanf("%lld",&aaa);return aaa;}
inline double dxt(){double aaa;scanf("%lf",&aaa);return aaa;}
template <class T> inline T bigmod(T p,T e,T m){T ret = 1;
for(; e > 0; e >>= 1){
    if(e & 1) ret = (ret * p) % m;p = (p * p) % m;
} return (T)ret;}
#ifdef obaydullah
     #define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template < typename Arg1 >
    void __f(const char* name, Arg1&& arg1){
        cerr << name << " is " << arg1 << std::endl;
    }
    template < typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names+1, ',');
        cerr.write(names, comma - names) << " is " << arg1 <<" | ";
        __f(comma+1, args...);
    }
#else
    #define debug(...)
#endif
///******************************************START******************************************
template<class T>
istream& operator>>(istream& is, vector<T>& input){
    for(T& in:input) is >> in; return is;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T> &input){
    bool isFirst=true;for(T out:input){if(isFirst){os<<out;isFirst=false;}else os<<" "<<out;}return os;
}
const int inf = INT_MAX/3;
vector<vector<int> > adj;
vector<bool> vis;vector<int> depth, hello;
void addEdge(int u, int v){
    adj[u].emplace_back(v);
    adj[v].emplace_back(u);
}
int mn = INT_MAX/3, here = -1,another = -1;
void dfs(int node, int& dp,int dep = 0,int par = -1){
    vis[node] = true;
    depth[node] = dep;
    dp++;
    hello[node] = dp;
    for(int v:adj[node]){
        if(v == par) continue; ///Ignore parent
        if(!vis[v]){        ///Tree edge
            dfs(v,dp,dep+1,node);
        }
        else{
            if(abs(hello[node]-hello[v])<mn) here = v, mn = abs(hello[node]-hello[v]), another = node;
        }
    }
}
int n, m, x;
vector<int> odd, even;
void bfs(){
    queue<int> q; q.push(1);
    vector<int> visited(n+1,-1);
    visited[1] = 0; even.push_back(1);
    while(!q.empty()){
        int u = q.front(); q.pop();
        for(int v:adj[u]){
            if(visited[v]==-1){
                visited[v] = visited[u]+1;
                if(visited[v]&1) odd.push_back(v);
                else even.push_back(v);
                q.push(v);
            }
        }
    }
}
void solve(){
    n=nxt(), m=nxt(), x=nxt();
    adj.resize(n+1); vis.assign(n+1,0);
    depth.assign(n+1,0); hello.assign(n+1,0);
    for(int i=0;i<m;i++){
        int u=nxt(), v=nxt();
        addEdge(u,v);
    }
    int dp = 0;
    dfs(1, dp);
    vector<int> ans;
    int go = here;
    int cnt = 0;
    while(go!=another){
        ans.push_back(go);
        bool ok = true;
        for(int v:adj[go]){
            if(hello[v] == hello[go]+1){
                ok=false;
                go = v;
                break;
            }
        }
        if(ok){
            another = -1; ans.clear(); break;
        }
    }
    if(another !=-1) ans.push_back(another);
    if(sz(ans)>0 && sz(ans)<=x){
        cout<<2<<nl;
        cout<<sz(ans)<<nl;
        cout<<ans<<nl;
        return;
    }
    bfs();
    if(sz(odd)>=((x+1)/2)){
        cout<<1<<nl;
        for(int i=0;i<((x+1)/2);i++) cout<<odd[i]<<" ";
        cout<<nl; return;
    }
    if(sz(even)>=((x+1)/2)){
        cout<<1<<nl;
        for(int i = 0;i<((x+1)/2);i++) cout<<even[i]<<" ";
        cout<<nl; return;
    }
    assert(here!=-1);
    assert(mn+1<=x);
    cout<<2<<nl;
    cout<<sz(ans)<<nl;
    cout<<ans<<nl;

}
int main()
{
    //Fast_Read
    Precision(10)
#ifdef obaydullah
    double start_time = clock();
    ///freopen ("output.txt","w",stdout);
    ///freopen ("input.txt","r",stdin);
#endif
    int tc=1;
    while(tc--)
    {
        solve();
    }
#ifdef obaydullah
    double end_time = clock();
    cerr<<"Time = "<<fixed<<setprecision(10)<<(end_time - start_time) / CLOCKS_PER_SEC<<'\n';
#endif

    return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define foru(i, a, b) for(int i = (a); i <= (b); i++)
#define ford(i, a, b) for(int i = (a); i >= (b); i--)
#define endl "\n"
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
#define com(a, b) a ## b
#define scv(a, b, c) #a#b#c
#define db(x) cerr << "[" << #x << ": " << (x) << "] " << endl;
#define run cerr << "DONE" << endl;
template<class T> void printvec(vector<T>& x, int a, int b) {foru (i, a, b) cout << x[i] << " "; cout << endl;}

typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vii;
typedef vector<pll> v2l;
typedef pair<char, int> pci;
typedef vector<pci> vci;

const ld PI = acos((ld) -1);
const ld EPSILON = 1e-7;
const int N = 1e6 + 2;
const int NN = 1e3 + 1;
const ll MOD = 1e9 + 7;
const ll oo = LLONG_MAX;
const int BASE = 10000;
const int di[4] = {-1, 0, 1, 0};
const int dj[4] = {0, 1, 0, -1};

vector<vector<int>> g;
vector<int> num, par, low;
int n, m, k, check = 0;

void DFS(int u, int time) {
    num[u] = time;
    for (int v : g[u]) {
        if (!num[v]) {
            par[v] = u;
            DFS(v, time + 1);
            if (check) {
                return;
            }
        } else {
            if (v != par[u] && num[v] < num[u]) {
                low[u] = max(low[u], num[v]);
            }
        }
    }
    if (num[u] - low[u] + 1 <= k && low[u]) {
        cout << 2 << endl << num[u] - low[u] + 1 << endl;
        int cur = u;
        while (num[cur] != low[u]) {
            cout << cur << " ";
            cur = par[cur];
        }
        cout << cur << endl;
        check = 1;
    }
}

void query() {
    cin >> n >> m >> k;
    g = vector<vector<int>>(n + 1);
    for (int i = 1; i <= m; i++) {
        int u, v;
        cin >> u >> v;
        g[u].pb(v);
        g[v].pb(u);
    }
    num = par = low = vector<int>(n + 1);
    DFS(1, 1);
    // cout << endl;
    // for (int i = 1; i <= n; i++) {
    //     cout << num[i] << " " << low[i] << endl;
    // }
    if (check) {
        return;
    }
    unordered_set<int> res;
    for (int i = 1; i <= n; i++) {
        res.insert(i);
    }
    for (int i = 1; i <= n; i++) {
        if (res.count(i)) {
            for (int x : g[i]) {
                res.erase(x);
            }
        }
    }
    cout << 1 << endl;
    int cnt = 0;
    for (int x : res) {
        cout << x << " ";
        cnt++;
        if (cnt == (k + 1) / 2) {
            break;
        }
    }
}

void solve() {
    int t = 1;
    // cin >> t;
    while (t--) {
        query();
    }
}

int main() {
    #ifdef DEBUG
        com(fre, open) (scv(solve, ., inp), "r", stdin);
        com(fre, open) (scv(solve, ., out), "w", stdout);
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cout << fixed << setprecision(10);
    solve();
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define foru(i, a, b) for(int i = (a); i <= (b); i++)
#define ford(i, a, b) for(int i = (a); i >= (b); i--)
#define endl "\n"
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
#define com(a, b) a ## b
#define scv(a, b, c) #a#b#c
#define db(x) cerr << "[" << #x << ": " << (x) << "] " << endl;
#define run cerr << "DONE" << endl;
template<class T> void printvec(vector<T>& x, int a, int b) {foru (i, a, b) cout << x[i] << " "; cout << endl;}

typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vii;
typedef vector<pll> v2l;
typedef pair<char, int> pci;
typedef vector<pci> vci;

const ld PI = acos((ld) -1);
const ld EPSILON = 1e-7;
const int N = 1e6 + 2;
const int NN = 1e3 + 1;
const ll MOD = 1e9 + 7;
const ll oo = LLONG_MAX;
const int BASE = 10000;
const int di[4] = {-1, 0, 1, 0};
const int dj[4] = {0, 1, 0, -1};

vector<vector<int>> g;
vector<int> num, par, low, ord;
int n, m, k, check = 0;

void DFS(int u, int time) {
    ord.pb(u);
    num[u] = time;
    for (int v : g[u]) {
        if (!num[v]) {
            par[v] = u;
            DFS(v, time + 1);
            if (check) {
                return;
            }
        } else {
            if (v != par[u] && num[v] < num[u]) {
                low[u] = max(low[u], num[v]);
            }
        }
    }
    if (num[u] - low[u] + 1 <= k && low[u]) {
        cout << 2 << endl << num[u] - low[u] + 1 << endl;
        int cur = u;
        while (num[cur] != low[u]) {
            cout << cur << " ";
            cur = par[cur];
        }
        cout << cur << endl;
        check = 1;
    }
}

void query() {
    cin >> n >> m >> k;
    g = vector<vector<int>>(n + 1);
    for (int i = 1; i <= m; i++) {
        int u, v;
        cin >> u >> v;
        g[u].pb(v);
        g[v].pb(u);
    }
    num = par = low = vector<int>(n + 1);
    DFS(1, 1);
    // cout << endl;
    // for (int i = 1; i <= n; i++) {
    //     cout << num[i] << " " << low[i] << endl;
    // }
    if (check) {
        return;
    }
    cout << 1 << endl;
    for (int i = 1; i <= (k + 1) / 2; i++) {
        cout << ord[2 * i - 2] << " ";
    }
}

void solve() {
    int t = 1;
    // cin >> t;
    while (t--) {
        query();
    }
}

int main() {
    #ifdef DEBUG
        com(fre, open) (scv(solve, ., inp), "r", stdin);
        com(fre, open) (scv(solve, ., out), "w", stdout);
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cout << fixed << setprecision(10);
    solve();
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define foru(i, a, b) for(int i = (a); i <= (b); i++)
#define ford(i, a, b) for(int i = (a); i >= (b); i--)
#define endl "\n"
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
#define com(a, b) a ## b
#define scv(a, b, c) #a#b#c
#define db(x) cerr << "[" << #x << ": " << (x) << "] " << endl;
#define run cerr << "DONE" << endl;
template<class T> void printvec(vector<T>& x, int a, int b) {foru (i, a, b) cout << x[i] << " "; cout << endl;}

typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vii;
typedef vector<pll> v2l;
typedef pair<char, int> pci;
typedef vector<pci> vci;

const ld PI = acos((ld) -1);
const ld EPSILON = 1e-7;
const int N = 1e6 + 2;
const int NN = 1e3 + 1;
const ll MOD = 1e9 + 7;
const ll oo = LLONG_MAX;
const int BASE = 10000;
const int di[4] = {-1, 0, 1, 0};
const int dj[4] = {0, 1, 0, -1};

vector<vector<int>> g;
vector<int> num, par, low, h;
int n, m, k, check = 0;

void DFS(int u, int time) {
    num[u] = time;
    for (int v : g[u]) {
        if (!num[v]) {
            h[v] = h[u] + 1;
            par[v] = u;
            DFS(v, time + 1);
            if (check) {
                return;
            }
        } else {
            if (v != par[u] && num[v] < num[u]) {
                low[u] = max(low[u], num[v]);
            }
        }
    }
    if (num[u] - low[u] + 1 <= k && low[u]) {
        cout << 2 << endl << num[u] - low[u] + 1 << endl;
        int cur = u;
        while (num[cur] != low[u]) {
            cout << cur << " ";
            cur = par[cur];
        }
        cout << cur << endl;
        check = 1;
    }
}

void query() {
    cin >> n >> m >> k;
    g = vector<vector<int>>(n + 1);
    for (int i = 1; i <= m; i++) {
        int u, v;
        cin >> u >> v;
        g[u].pb(v);
        g[v].pb(u);
    }
    num = par = low = h = vector<int>(n + 1);
    DFS(1, 1);
    if (check) {
        return;
    }
    cout << 1 << endl;
    vector<int> odd, even;
    for (int i = 1; i <= n; i++) {
        if (h[i] % 2) {
            odd.pb(i);
        } else {
            even.pb(i);
        }
    }
    if (sz(odd) >= (k + 1) / 2) {
        for (int i = 0; i < (k + 1) / 2; i++) {
            cout << odd[i] << " ";
        }
    } else {
        for (int i = 0; i < (k + 1) / 2; i++) {
            cout << even[i] << " ";
        }
    }
}

void solve() {
    int t = 1;
    // cin >> t;
    while (t--) {
        query();
    }
}

int main() {
    #ifdef DEBUG
        com(fre, open) (scv(solve, ., inp), "r", stdin);
        com(fre, open) (scv(solve, ., out), "w", stdout);
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cout << fixed << setprecision(10);
    solve();
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define foru(i, a, b) for(int i = (a); i <= (b); i++)
#define ford(i, a, b) for(int i = (a); i >= (b); i--)
#define endl "\n"
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
#define com(a, b) a ## b
#define scv(a, b, c) #a#b#c
#define db(x) cerr << "[" << #x << ": " << (x) << "] " << endl;
#define run cerr << "DONE" << endl;
template<class T> void printvec(vector<T>& x, int a, int b) {foru (i, a, b) cout << x[i] << " "; cout << endl;}

typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vii;
typedef vector<pll> v2l;
typedef pair<char, int> pci;
typedef vector<pci> vci;

const ld PI = acos((ld) -1);
const ld EPSILON = 1e-7;
const int N = 1e6 + 2;
const int NN = 1e3 + 1;
const ll MOD = 1e9 + 7;
const ll oo = LLONG_MAX;
const int BASE = 10000;
const int di[4] = {-1, 0, 1, 0};
const int dj[4] = {0, 1, 0, -1};

vector<vector<int>> g;
vector<int> num, par, low;
int n, m, k, check = 0;

void DFS(int u, int time) {
    num[u] = time;
    for (int v : g[u]) {
        if (!num[v]) {
            par[v] = u;
            DFS(v, time + 1);
            if (check) {
                return;
            }
        } else {
            if (v != par[u] && num[v] < num[u]) {
                low[u] = max(low[u], num[v]);
            }
        }
    }
    if (num[u] - low[u] + 1 <= k && low[u]) {
        cout << 2 << endl << num[u] - low[u] + 1 << endl;
        int cur = u;
        while (num[cur] != low[u]) {
            cout << cur << " ";
            cur = par[cur];
        }
        cout << cur << endl;
        check = 1;
    }
}

void query() {
    cin >> n >> m >> k;
    g = vector<vector<int>>(n + 1);
    for (int i = 1; i <= m; i++) {
        int u, v;
        cin >> u >> v;
        g[u].pb(v);
        g[v].pb(u);
    }
    num = par = low = vector<int>(n + 1);
    DFS(1, 1);
    // cout << endl;
    // for (int i = 1; i <= n; i++) {
    //     cout << num[i] << " " << low[i] << endl;
    // }
    if (check) {
        return;
    }
    unordered_set<int> res;
    for (int i = 1; i <= n; i++) {
        int check = 1;
        for (int v : g[i]) {
            if (res.count(v)) {
                check = 0;
                break;
            }
        }
        if (check) {
            res.insert(i);
        }
    }
    cout << 1 << endl;
    int cnt = 0;
    if (sz(res) >= (k + 1) / 2) {
        for (int x : res) {
            cout << x << " ";
            cnt++;
            if (cnt == (k + 1) / 2) {
                break;
            }
        }
    } else {
        for (int i = 1; i <= n; i++) {
            if (!res.count(i)) {
                cout << i << " ";
            }
        }
    }
}

void solve() {
    int t = 1;
    // cin >> t;
    while (t--) {
        query();
    }
}

int main() {
    #ifdef DEBUG
        com(fre, open) (scv(solve, ., inp), "r", stdin);
        com(fre, open) (scv(solve, ., out), "w", stdout);
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cout << fixed << setprecision(10);
    solve();
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define foru(i, a, b) for(int i = (a); i <= (b); i++)
#define ford(i, a, b) for(int i = (a); i >= (b); i--)
#define endl "\n"
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
#define com(a, b) a ## b
#define scv(a, b, c) #a#b#c
#define db(x) cerr << "[" << #x << ": " << (x) << "] " << endl;
#define run cerr << "DONE" << endl;
template<class T> void printvec(vector<T>& x, int a, int b) {foru (i, a, b) cout << x[i] << " "; cout << endl;}

typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vii;
typedef vector<pll> v2l;
typedef pair<char, int> pci;
typedef vector<pci> vci;

const ld PI = acos((ld) -1);
const ld EPSILON = 1e-7;
const int N = 1e6 + 2;
const int NN = 1e3 + 1;
const ll MOD = 1e9 + 7;
const ll oo = LLONG_MAX;
const int BASE = 10000;
const int di[4] = {-1, 0, 1, 0};
const int dj[4] = {0, 1, 0, -1};

vector<vector<int>> g;
vector<int> num, par, low;
int n, m, k, check = 0;

void DFS(int u, int time) {
    num[u] = time;
    for (int v : g[u]) {
        if (!num[v]) {
            par[v] = u;
            DFS(v, time + 1);
            if (check) {
                return;
            }
        } else {
            if (v != par[u] && num[v] < num[u]) {
                low[u] = max(low[u], num[v]);
            }
        }
    }
    if (num[u] - low[u] + 1 <= k && low[u]) {
        cout << 2 << endl << num[u] - low[u] + 1 << endl;
        int cur = u;
        while (num[cur] != low[u]) {
            cout << cur << " ";
            cur = par[cur];
        }
        cout << cur << endl;
        check = 1;
    }
}

void query() {
    cin >> n >> m >> k;
    g = vector<vector<int>>(n + 1);
    for (int i = 1; i <= m; i++) {
        int u, v;
        cin >> u >> v;
        g[u].pb(v);
        g[v].pb(u);
    }
    num = par = low = vector<int>(n + 1);
    DFS(1, 1);
    // cout << endl;
    // for (int i = 1; i <= n; i++) {
    //     cout << num[i] << " " << low[i] << endl;
    // }
    if (check) {
        return;
    }
    unordered_set<int> res;
    for (int i = 1; i <= n; i++) {
        int check = 1;
        for (int v : g[i]) {
            if (res.count(v)) {
                check = 0;
                break;
            }
        }
        if (check) {
            res.insert(i);
        }
    }
    cout << 1 << endl;
    int cnt = 0;
    for (int x : res) {
        cout << x << " ";
        cnt++;
        if (cnt == (k + 1) / 2) {
            break;
        }
    }
}

void solve() {
    int t = 1;
    // cin >> t;
    while (t--) {
        query();
    }
}

int main() {
    #ifdef DEBUG
        com(fre, open) (scv(solve, ., inp), "r", stdin);
        com(fre, open) (scv(solve, ., out), "w", stdout);
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cout << fixed << setprecision(10);
    solve();
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define foru(i, a, b) for(int i = (a); i <= (b); i++)
#define ford(i, a, b) for(int i = (a); i >= (b); i--)
#define endl "\n"
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
#define com(a, b) a ## b
#define scv(a, b, c) #a#b#c
#define db(x) cerr << "[" << #x << ": " << (x) << "] " << endl;
#define run cerr << "DONE" << endl;
template<class T> void printvec(vector<T>& x, int a, int b) {foru (i, a, b) cout << x[i] << " "; cout << endl;}

typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vii;
typedef vector<pll> v2l;
typedef pair<char, int> pci;
typedef vector<pci> vci;

const ld PI = acos((ld) -1);
const ld EPSILON = 1e-7;
const int N = 1e6 + 2;
const int NN = 1e3 + 1;
const ll MOD = 1e9 + 7;
const ll oo = LLONG_MAX;
const int BASE = 10000;
const int di[4] = {-1, 0, 1, 0};
const int dj[4] = {0, 1, 0, -1};

vector<vector<int>> g;
vector<int> num, par, low, chose;
int n, m, k, check = 0;

void DFS(int u, int time) {
    num[u] = time;
    for (int v : g[u]) {
        if (!num[v]) {
            par[v] = u;
            DFS(v, time + 1);
            if (check) {
                return;
            }
        } else {
            if (v != par[u] && num[v] < num[u]) {
                low[u] = max(low[u], num[v]);
            }
        }
    }
    if (num[u] - low[u] + 1 <= k && low[u]) {
        cout << 2 << endl << num[u] - low[u] + 1 << endl;
        int cur = u;
        while (num[cur] != low[u]) {
            cout << cur << " ";
            cur = par[cur];
        }
        cout << cur << endl;
        check = 1;
    }
}

void DFSans(int u, int vali) {
    num[u] = 1;
    if (vali) {
        chose.pb(u);
    }
    for (int v : g[u]) {
        if (!num[v]) {
            DFSans(v, 1 - vali);
        }
    }
}

void query() {
    cin >> n >> m >> k;
    g = vector<vector<int>>(n + 1);
    for (int i = 1; i <= m; i++) {
        int u, v;
        cin >> u >> v;
        g[u].pb(v);
        g[v].pb(u);
    }
    num = par = low = vector<int>(n + 1);
    DFS(1, 1);
    // cout << endl;
    // for (int i = 1; i <= n; i++) {
    //     cout << num[i] << " " << low[i] << endl;
    // }
    if (check) {
        return;
    }
    num = vector<int>(n + 1, 0);
    DFSans(1, 1);
    cout << 1 << endl;
    // cout << sz(chose);
    for (int i = 0; i < (k + 1) / 2; i++) {
        cout << chose[i] << " ";
    }
}

void solve() {
    int t = 1;
    // cin >> t;
    while (t--) {
        query();
    }
}

int main() {
    #ifdef DEBUG
        com(fre, open) (scv(solve, ., inp), "r", stdin);
        com(fre, open) (scv(solve, ., out), "w", stdout);
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cout << fixed << setprecision(10);
    solve();
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define foru(i, a, b) for(int i = (a); i <= (b); i++)
#define ford(i, a, b) for(int i = (a); i >= (b); i--)
#define endl "\n"
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
#define com(a, b) a ## b
#define scv(a, b, c) #a#b#c
#define db(x) cerr << "[" << #x << ": " << (x) << "] " << endl;
#define run cerr << "DONE" << endl;
template<class T> void printvec(vector<T>& x, int a, int b) {foru (i, a, b) cout << x[i] << " "; cout << endl;}

typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vii;
typedef vector<pll> v2l;
typedef pair<char, int> pci;
typedef vector<pci> vci;

const ld PI = acos((ld) -1);
const ld EPSILON = 1e-7;
const int N = 1e6 + 2;
const int NN = 1e3 + 1;
const ll MOD = 1e9 + 7;
const ll oo = LLONG_MAX;
const int BASE = 10000;
const int di[4] = {-1, 0, 1, 0};
const int dj[4] = {0, 1, 0, -1};

vector<vector<int>> g;
vector<int> num, par, low;
int n, m, k, check = 0;

void DFS(int u, int time) {
    num[u] = time;
    for (int v : g[u]) {
        if (!num[v]) {
            par[v] = u;
            DFS(v, time + 1);
            if (check) {
                return;
            }
        } else {
            if (v != par[u] && num[v] < num[u]) {
                low[u] = max(low[u], num[v]);
            }
        }
    }
    if (num[u] - low[u] + 1 <= k && low[u]) {
        cout << 2 << endl << num[u] - low[u] + 1 << endl;
        int cur = u;
        while (num[cur] != low[u]) {
            cout << cur << " ";
            cur = par[cur];
        }
        cout << cur << endl;
        check = 1;
    }
}

void query() {
    cin >> n >> m >> k;
    g = vector<vector<int>>(n + 1);
    for (int i = 1; i <= m; i++) {
        int u, v;
        cin >> u >> v;
        g[u].pb(v);
        g[v].pb(u);
    }
    num = par = low = vector<int>(n + 1);
    DFS(1, 1);
    // cout << endl;
    // for (int i = 1; i <= n; i++) {
    //     cout << num[i] << " " << low[i] << endl;
    // }
    if (check) {
        return;
    }
    vector<int> odd, even;
    for (int i = 1; i <= n; i++) {
        if (num[i] % 2) {
            odd.pb(i);
        } else {
            even.pb(i);
        }
    }
    cout << 1 << endl;
    if (sz(odd) >= (k + 1) / 2) {
        for (int i = 0; i < (k + 1) / 2; i++) {
            cout << odd[i] << " ";
        }
    } else {
        for (int i = 0; i < (k + 1) / 2; i++) {
            cout << even[i] << " ";
        }
    }
}

void solve() {
    int t = 1;
    // cin >> t;
    while (t--) {
        query();
    }
}

int main() {
    #ifdef DEBUG
        com(fre, open) (scv(solve, ., inp), "r", stdin);
        com(fre, open) (scv(solve, ., out), "w", stdout);
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cout << fixed << setprecision(10);
    solve();
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define foru(i, a, b) for(int i = (a); i <= (b); i++)
#define ford(i, a, b) for(int i = (a); i >= (b); i--)
#define endl "\n"
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
#define com(a, b) a ## b
#define scv(a, b, c) #a#b#c
#define db(x) cerr << "[" << #x << ": " << (x) << "] " << endl;
#define run cerr << "DONE" << endl;
template<class T> void printvec(vector<T>& x, int a, int b) {foru (i, a, b) cout << x[i] << " "; cout << endl;}

typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vii;
typedef vector<pll> v2l;
typedef pair<char, int> pci;
typedef vector<pci> vci;

const ld PI = acos((ld) -1);
const ld EPSILON = 1e-7;
const int N = 1e6 + 2;
const int NN = 1e3 + 1;
const ll MOD = 1e9 + 7;
const ll oo = LLONG_MAX;
const int BASE = 10000;
const int di[4] = {-1, 0, 1, 0};
const int dj[4] = {0, 1, 0, -1};

vector<vector<int>> g;
vector<int> num, par, low;
int n, m, k, check = 0;

void DFS(int u, int time) {
    num[u] = time;
    for (int v : g[u]) {
        if (!num[v]) {
            par[v] = u;
            DFS(v, time + 1);
            if (check) {
                return;
            }
        } else {
            if (v != par[u] && num[v] < num[u]) {
                low[u] = max(low[u], num[v]);
            }
        }
    }
    if (num[u] - low[u] + 1 <= k && low[u]) {
        cout << 2 << endl << num[u] - low[u] + 1 << endl;
        int cur = u;
        while (num[cur] != low[u]) {
            cout << cur << " ";
            cur = par[cur];
        }
        cout << cur << endl;
        check = 1;
    }
}

void query() {
    cin >> n >> m >> k;
    g = vector<vector<int>>(n + 1);
    for (int i = 1; i <= m; i++) {
        int u, v;
        cin >> u >> v;
        g[u].pb(v);
        g[v].pb(u);
    }
    num = par = low = vector<int>(n + 1);
    DFS(1, 1);
    // cout << endl;
    // for (int i = 1; i <= n; i++) {
    //     cout << num[i] << " " << low[i] << endl;
    // }
    if (check) {
        return;
    }
    unordered_set<int> res;
    for (int i = 1; i <= n; i++) {
        int check = 1;
        for (int v : g[i]) {
            if (res.count(v)) {
                check = 0;
                break;
            }
        }
        if (check) {
            res.insert(i);
        }
    }
    cout << 1 << endl;
    int cnt = 0;
    for (int x : res) {
        cout << x << " ";
        cnt++;
        if (cnt > (k + 1) / 2) {
            break;
        }
    }
}

void solve() {
    int t = 1;
    // cin >> t;
    while (t--) {
        query();
    }
}

int main() {
    #ifdef DEBUG
        com(fre, open) (scv(solve, ., inp), "r", stdin);
        com(fre, open) (scv(solve, ., out), "w", stdout);
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cout << fixed << setprecision(10);
    solve();
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    return 0;
}


/*
   Salim Shebli
   Russian,Syrian
   Faculty Of Information Technology
   University of Damascus
   Game Developer
 */
#include <bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
using namespace std;
ll n,k;
ll cc;
vector<pair<ll,ll> >g[100100];
bool vis[100100];
stack<ll>z;
int col[100100];
bool dfs1(int v,int p)
{
   // cout<<"ST  "<<v<<endl;
    vis[v]=1;
    z.push(v);
    col[v]=1;
    for(int i=0;i<g[v].size();i++)
    {
        ll to=g[v][i].second;
        if(to==p)continue;
    //    cout<<v<<" "<<to<<" "<<g[v][i].first<<endl;
        if(vis[to])
        {

            if(col[to]==1&&z.size()<=k)
            {
               // cout<<v<<" "<<to<<" "<<z.size()<<endl;
                return 1;
            }
        }
        else{
            bool ss=dfs1(to,v);
            if(ss)return 1;
        }
    }
    col[v]=2;
    z.pop();
    return 0;
}
int main()
{
    ios::sync_with_stdio(false);
    ll m;
    cin>>n>>m>>k;
    cc=k/2+(k%2);
    for(int i=0;i<m;i++)
    {
        ll a,b;
        cin>>a>>b;
        g[a].pb({0,b});
        g[b].pb({0,a});
    }
    ll mx=0;
    ll id=-1;
    for(int i=1;i<=n;i++)
    {
        if(g[i].size()>mx)
        {
            mx=g[i].size();
            id=i;
        }
        for(int j=0;j<g[i].size();j++)
        {
            ll v=g[i][j].second;
        //    cout<<i<<"  "<<v<<" "<<g[v].size()<<endl;
            g[i][j].first=g[v].size();
        }
        sort(g[i].begin(),g[i].end());
    }
    bool ss=dfs1(id,-1);
    if(ss)
    {
        vector<ll>pp;
        while(!z.empty())
        {
            ll f=z.top();
            z.pop();
            pp.pb(f);
        }
        reverse(pp.begin(),pp.end());
        cout<<2<<endl;
        cout<<pp.size()<<endl;
        for(int i=0;i<pp.size();i++)
        {
            cout<<pp[i]<<" ";
        }

    }
    else
    {
        vector<ll>sol;
        set<pair<ll,ll> >w;
        for(int i=1;i<=n;i++)
        {
            w.insert({g[i].size(),i});
        }
        memset(vis,0,sizeof vis);
        while(!w.empty())
        {
            pair<ll,ll> x=*w.begin();
            w.erase(w.begin());

            sol.pb(x.second);
            ll v=x.second;
            vis[v]=1;
            for(int i=0;i<g[v].size();i++)
            {
                ll to=g[v][i].second;
                if(!vis[to])
                {
                    w.erase({g[to].size(),to});
                }
            }
            if(sol.size()>=cc)break;
        }
        cout<<1<<endl;
        for(int i=0;i<sol.size();i++)
        {
            cout<<sol[i]<<" ";
        }
        cout<<endl;
    }
    return 0;

}


/*
   Salim Shebli
   Russian,Syrian
   Faculty Of Information Technology
   University of Damascus
   Game Developer
 */
#include <bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
using namespace std;
ll n,k;
ll cc;
vector<pair<ll,ll> >g[100100];
bool vis[100100];
stack<ll>z;
int col[100100];
int zz;
vector<ll>pp;

bool dfs1(int v,int p)
{
   // cout<<"ST  "<<v<<endl;
    vis[v]=1;
    z.push(v);
    col[v]=z.size();
    for(int i=0;i<g[v].size();i++)
    {
        ll to=g[v][i].second;
        if(to==p)continue;
    //    cout<<v<<" "<<to<<" "<<g[v][i].first<<endl;
        if(vis[to])
        {
           // cout<<z.size()<<"  "<<col[v]<<endl;
            if(col[to]==1&&(z.size()-col[to]+1)<=k)
            {
                  while(!z.empty())
                    {
                        ll f=z.top();
                        z.pop();
                        pp.pb(f);
                        if(f==to)
                            break;
                    }
               // cout<<v<<" "<<to<<" "<<z.size()<<endl;
                return 1;
            }
            zz=v;
        }
        else{
            bool ss=dfs1(to,v);
            if(ss)return 1;
        }
    }
    col[v]=2;
    z.pop();
    return 0;
}
ll rr[100100];
int main()
{
    ios::sync_with_stdio(false);
    ll m;
    cin>>n>>m>>k;
    cc=k/2+(k%2);
    for(int i=0;i<m;i++)
    {
        ll a,b;
        cin>>a>>b;
        g[a].pb({0,b});
        g[b].pb({0,a});
    }
    ll mx=0;
    ll id=-1;
    for(int i=1;i<=n;i++)
    {
        if(g[i].size()>mx)
        {
            mx=g[i].size();
            id=i;
        }
        for(int j=0;j<g[i].size();j++)
        {
            ll v=g[i][j].second;
        //    cout<<i<<"  "<<v<<" "<<g[v].size()<<endl;
            g[i][j].first=g[v].size();
        }
        sort(g[i].begin(),g[i].end());
    }
    bool ss=dfs1(id,-1);
    if(ss)
    {

        reverse(pp.begin(),pp.end());
        cout<<2<<endl;
        cout<<pp.size()<<endl;
        for(int i=0;i<pp.size();i++)
        {
            cout<<pp[i]<<" ";
        }

    }
    else
    {
        vector<ll>sol;
        queue<ll>q;
        if(zz==0)zz=1;
        q.push(zz);
        rr[zz]=0;
        ll tot0=1;
        ll tot1=0;
        memset(vis,0,sizeof vis);
        vis[zz]=1;
        //cout<<zz<<endl;
        while(!q.empty())
        {
            ll v=q.front();
            q.pop();
            for(int j=0;j<g[v].size();j++)
            {
                ll to=g[v][j].second;
                if(!vis[to])
                {
                    rr[to]=(rr[v]+1)%2;
                    //cout<<to<<" "<<rr[to]<<endl;
                    if(rr[to]==0)tot0++;
                    else tot1++;
                    vis[to]=1;
                    q.push(to);
                }
            }
        }
        if(tot0>=tot1||tot0>=cc)
        {
            for(int i=1;i<=n;i++)
            {
               if(rr[i]==0)
                sol.pb(i);
            }
        }
        else
        {
             for(int i=1;i<=n;i++)
            {
               if(rr[i]==1)
                sol.pb(i);
            }
        }
        cout<<1<<endl;
        for(int i=0;i<min((ll)sol.size(),cc);i++)
        {
            cout<<sol[i]<<" ";
        }
        cout<<endl;
    }
    return 0;

}


/*
   Salim Shebli
   Russian,Syrian
   Faculty Of Information Technology
   University of Damascus
   Game Developer
 */
#include <bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
using namespace std;
ll n,k;
ll cc;
vector<pair<ll,ll> >g[100100];
bool vis[100100];
stack<ll>z;
int col[100100];
int zz;
bool dfs1(int v,int p)
{
   // cout<<"ST  "<<v<<endl;
    vis[v]=1;
    z.push(v);
    col[v]=1;
    for(int i=0;i<g[v].size();i++)
    {
        ll to=g[v][i].second;
        if(to==p)continue;
    //    cout<<v<<" "<<to<<" "<<g[v][i].first<<endl;
        if(vis[to])
        {

            if(col[to]==1&&z.size()<=k)
            {
               // cout<<v<<" "<<to<<" "<<z.size()<<endl;
                return 1;
            }
            zz=v;
        }
        else{
            bool ss=dfs1(to,v);
            if(ss)return 1;
        }
    }
    col[v]=2;
    z.pop();
    return 0;
}
ll rr[100100];
int main()
{
    ios::sync_with_stdio(false);
    ll m;
    cin>>n>>m>>k;
    cc=k/2+(k%2);
    for(int i=0;i<m;i++)
    {
        ll a,b;
        cin>>a>>b;
        g[a].pb({0,b});
        g[b].pb({0,a});
    }
    ll mx=0;
    ll id=-1;
    for(int i=1;i<=n;i++)
    {
        if(g[i].size()>mx)
        {
            mx=g[i].size();
            id=i;
        }
        for(int j=0;j<g[i].size();j++)
        {
            ll v=g[i][j].second;
        //    cout<<i<<"  "<<v<<" "<<g[v].size()<<endl;
            g[i][j].first=g[v].size();
        }
        sort(g[i].begin(),g[i].end());
    }
    bool ss=dfs1(id,-1);
    if(ss)
    {
        vector<ll>pp;
        while(!z.empty())
        {
            ll f=z.top();
            z.pop();
            pp.pb(f);
        }
        reverse(pp.begin(),pp.end());
        cout<<2<<endl;
        cout<<pp.size()<<endl;
        for(int i=0;i<pp.size();i++)
        {
            cout<<pp[i]<<" ";
        }

    }
    else
    {
        vector<ll>sol;
        queue<ll>q;
        if(zz==0)zz=1;
        q.push(zz);
        rr[zz]=0;
        ll tot0=1;
        ll tot1=0;
        vis[zz]=1;
        while(!q.empty())
        {
            ll v=q.front();
            q.pop();
            for(int j=0;j<g[v].size();j++)
            {
                ll to=g[v][j].second;
                if(!vis[to])
                {
                    rr[to]=(rr[v]+1)%2;
                    if(rr[to]==0)tot0++;
                    else tot1++;
                    vis[to]=1;
                    q.push(to);
                }
            }
        }
        if(tot0>=tot1||tot0>=cc)
        {
            for(int i=1;i<=n;i++)
            {
               if(rr[i]==0)
                sol.pb(i);
            }
        }
        else
        {
             for(int i=1;i<=n;i++)
            {
               if(rr[i]==1)
                sol.pb(i);
            }
        }
        cout<<1<<endl;
        for(int i=0;i<min((ll)sol.size(),cc);i++)
        {
            cout<<sol[i]<<" ";
        }
        cout<<endl;
    }
    return 0;

}


/*
   Salim Shebli
   Russian,Syrian
   Faculty Of Information Technology
   University of Damascus
   Game Developer
 */
#include <bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
using namespace std;
ll n,k;
ll cc;
vector<ll>g[100100];
bool vis[100100];
stack<ll>z;
ll pos[100100];
vector<ll>col[3];
vector<ll>ck;
bool dfs(int v,int p,bool c)
{
    vis[v]=1;
    z.push(v);
    pos[v]=z.size();//<<endl;
   // cout<<v<<" "<<pos[v]<<endl;
    col[c].pb(v);
    ll bbest=1e7;
    ll id=-1;
    for(int i=0;i<g[v].size();i++)
    {
        ll to=g[v][i];
        if(p==to)continue;
        if(vis[to])
        {
            if(pos[v]-pos[to]+1<bbest)
            {
                bbest=pos[v]-pos[to]+1;
                id=to;
            }
        }
    }
    if(id!=-1)
    {
        while(z.size()!=0)
        {
            ll f=z.top();
            z.pop();
            ck.pb(f);
            if(f==id)break;
        }
        return 1;
    }
    for(int i=0;i<g[v].size();i++)
    {
        ll to=g[v][i];
        if(!vis[to])
        {
            bool ss=dfs(to,v,!c);
            if(ss)return 1;
        }
    }
    return 0;
}

int main()
{
    ios::sync_with_stdio(false);
    ll m;
    cin>>n>>m>>k;
    cc=k/2+(k%2);
    for(int i=0;i<m;i++)
    {
        ll a,b;
        cin>>a>>b;
        g[a].pb(b);
        g[b].pb(a);
    }
    bool ss=dfs(1,-1,0);
 //   cout<<ss<<endl;
    if(!ss)
    {
        vector<ll>ww;
        if(col[0].size()>col[1].size())
        {
            ww=col[0];
        }
        else ww=col[1];
        cout<<1<<endl;
        for(int i=0;i<min(cc,(ll)ww.size());i++)
        {
            cout<<ww[i]<<" ";
        }
        cout<<endl;
        return 0;
    }
    if(ck.size()<=k)
    {
        cout<<2<<endl;
        cout<<ck.size()<<endl;
        for(int i=0;i<ck.size();i++)
        {
            cout<<ck[i]<<" ";
        }
        cout<<endl;
        return 0;
    }
    vector<ll>ww;
    for(int i=0;i<ck.size();i++)
    {
        if(i%2==0&&i!=ck.size()-1)
        {
            ww.pb(ck[i]);
        }
    }
     cout<<1<<endl;
        for(int i=0;i<min(cc,(ll)ww.size());i++)
        {
            cout<<ww[i]<<" ";
        }
        cout<<endl;
        return 0;

}


/*
   Salim Shebli
   Russian,Syrian
   Faculty Of Information Technology
   University of Damascus
   Game Developer
 */
#include <bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
using namespace std;
ll n,k;
ll cc;
vector<pair<ll,ll> >g[100100];
bool vis[100100];
stack<ll>z;
int col[100100];
int zz;
bool dfs1(int v,int p)
{
   // cout<<"ST  "<<v<<endl;
    vis[v]=1;
    z.push(v);
    col[v]=1;
    for(int i=0;i<g[v].size();i++)
    {
        ll to=g[v][i].second;
        if(to==p)continue;
    //    cout<<v<<" "<<to<<" "<<g[v][i].first<<endl;
        if(vis[to])
        {

            if(col[to]==1&&z.size()<=k)
            {
               // cout<<v<<" "<<to<<" "<<z.size()<<endl;
                return 1;
            }
            zz=v;
        }
        else{
            bool ss=dfs1(to,v);
            if(ss)return 1;
        }
    }
    col[v]=2;
    z.pop();
    return 0;
}
ll rr[100100];
int main()
{
    ios::sync_with_stdio(false);
    ll m;
    cin>>n>>m>>k;
    cc=k/2+(k%2);
    for(int i=0;i<m;i++)
    {
        ll a,b;
        cin>>a>>b;
        g[a].pb({0,b});
        g[b].pb({0,a});
    }
    ll mx=0;
    ll id=-1;
    for(int i=1;i<=n;i++)
    {
        if(g[i].size()>mx)
        {
            mx=g[i].size();
            id=i;
        }
        for(int j=0;j<g[i].size();j++)
        {
            ll v=g[i][j].second;
        //    cout<<i<<"  "<<v<<" "<<g[v].size()<<endl;
            g[i][j].first=g[v].size();
        }
        sort(g[i].begin(),g[i].end());
    }
    bool ss=dfs1(id,-1);
    if(ss)
    {
        vector<ll>pp;
        while(!z.empty())
        {
            ll f=z.top();
            z.pop();
            pp.pb(f);
        }
        reverse(pp.begin(),pp.end());
        cout<<2<<endl;
        cout<<pp.size()<<endl;
        for(int i=0;i<pp.size();i++)
        {
            cout<<pp[i]<<" ";
        }

    }
    else
    {
        vector<ll>sol;
        queue<ll>q;
        if(zz==0)zz=1;
        q.push(zz);
        rr[zz]=0;
        ll tot0=1;
        ll tot1=0;
        memset(vis,0,sizeof vis);
        vis[zz]=1;
        //cout<<zz<<endl;
        while(!q.empty())
        {
            ll v=q.front();
            q.pop();
            for(int j=0;j<g[v].size();j++)
            {
                ll to=g[v][j].second;
                if(!vis[to])
                {
                    rr[to]=(rr[v]+1)%2;
                    //cout<<to<<" "<<rr[to]<<endl;
                    if(rr[to]==0)tot0++;
                    else tot1++;
                    vis[to]=1;
                    q.push(to);
                }
            }
        }
        if(tot0>=tot1||tot0>=cc)
        {
            for(int i=1;i<=n;i++)
            {
               if(rr[i]==0)
                sol.pb(i);
            }
        }
        else
        {
             for(int i=1;i<=n;i++)
            {
               if(rr[i]==1)
                sol.pb(i);
            }
        }
        cout<<1<<endl;
        for(int i=0;i<min((ll)sol.size(),cc);i++)
        {
            cout<<sol[i]<<" ";
        }
        cout<<endl;
    }
    return 0;

}


/*
   Salim Shebli
   Russian,Syrian
   Faculty Of Information Technology
   University of Damascus
   Game Developer
 */
#include <bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
using namespace std;
ll n,k;
ll cc;
vector<ll>g[100100];
bool vis[100100];
stack<ll>z;
ll pos[100100];
vector<ll>col[3];
vector<ll>ck;
bool dfs(int v,int p)
{
    vis[v]=1;
    z.push(v);
    pos[v]=z.size();//<<endl;
    col[pos[v]%2].pb(v);
    ll bbest=1e7;
    ll id=-1;
    for(int i=0;i<g[v].size();i++)
    {
        ll to=g[v][i];
        if(p==to)continue;
        if(vis[to])
        {
            if(pos[v]-pos[to]+1<bbest)
            {
                bbest=pos[v]-pos[to]+1;
                id=to;
            }
        }
    }
    if(id!=-1)
    {
        while(z.size()!=0)
        {
            ll f=z.top();
            z.pop();
            ck.pb(f);
            if(f==id)break;
        }
        return 1;
    }
    for(int i=0;i<g[v].size();i++)
    {
        ll to=g[v][i];
        if(!vis[to])
        {
            bool ss=dfs(to,v);
            if(ss)return 1;
        }
    }
    return 0;
}

int main()
{
    ios::sync_with_stdio(false);
    ll m;
    cin>>n>>m>>k;
    cc=k/2+(k%2);
    for(int i=0;i<m;i++)
    {
        ll a,b;
        cin>>a>>b;
        g[a].pb(b);
        g[b].pb(a);
    }
    bool ss=dfs(1,-1);
    if(!ss)
    {
        vector<ll>ww;
        if(col[0].size()>col[1].size())
        {
            ww=col[0];
        }
        else ww=col[1];
        cout<<1<<endl;
        for(int i=0;i<min(cc,(ll)ww.size());i++)
        {
            cout<<ww[i]<<" ";
        }
        cout<<endl;
        return 0;
    }
    if(ck.size()<=k)
    {
        cout<<2<<endl;
        cout<<ck.size()<<endl;
        for(int i=0;i<ck.size();i++)
        {
            cout<<ck[i]<<" ";
        }
        cout<<endl;
        return 0;
    }
    vector<ll>ww;
    for(int i=0;i<ck.size();i++)
    {
        if(i%2==0&&i!=ck.size()-1)
        {
            ww.pb(ck[i]);
        }
    }
     cout<<1<<endl;
        for(int i=0;i<min(cc,(ll)ww.size());i++)
        {
            cout<<ww[i]<<" ";
        }
        cout<<endl;
        return 0;

}