#include <bits/stdc++.h>
#define ll  long long int
#define ld  double
#define MOD 1000000007
#define mem(a) memset(a,0,sizeof(a))
#define pb push_back
#define ff first
#define ss second
#define prf(n) printf("%lf\n",n)
#define scf(n) scanf("%lf", &n)
#define ios ios_base::sync_with_stdio(false)
#define INF INT_MAX

using namespace std;

vector<ll> adj[200010];
vector<ll>::iterator ii;
bool vis[200010];
vector<ll> path;
ll went;

void dfs(ll n)
{
	vis[n] = 1;
	path.pb(n);
	for(vector<ll>::iterator ii = adj[n].begin(); ii != adj[n].end(); ii++)
	{

		if(!vis[*ii])
		{
			ll x = *ii;
			dfs(x);
			path.pb(n);
		}
	}

}

int main()
{
	ll n, m, k, x, y;
	cin>>n>>m>>k;
	mem(vis);
	for(ll i = 0; i < m; i++)
	{
		cin>>x>>y;
		if(x != y)
		{
			adj[x].pb(y);
			adj[y].pb(x);
		}
	}
	// for(ll i = 1; i <= n; i++)
	// {
	// 	for(ii = adj[i].begin(); ii != adj[i].end(); ii++)
	// 		cout<<*ii<<" ";
	// 	cout<<endl;
	// }
	dfs(1);
	// for(ll i = 0; i<path.size(); i++)
	// 	cout<<path[i]<<" ";
	// cout<<endl;
	ll ind = 0;
	ll kk = ((2*n)%k) == 0 ? ((2*n)/k) : ((2*n)/k + 1) ;
	for(ll i = 1 ; i<=k; i++)
	{
		cout<<min((int)(kk), (int)path.size()-(int)ind)<<" ";
		for(ll j = ind; j<min((int)(ind+kk), (int)path.size()); j++)
			cout<<path[j]<<" ";
		ind += kk;
		cout<<endl;
		if(ind == path.size())
			ind--;

	}
	return 0;
}


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

#define fi(i,a,b)    for(long long i=a;i<=b;i++)
#define fr(i,a)      for(long long i=0;i<a;i++)
#define fd(i,a,b)    for(long long i=b;i>=a;i--)
#define clr(x)       memset(x,0,sizeof(x))
#define cln(x)       memset(x,-1,sizeof(x))
#define __           printf(" ")
#define _            printf("\n")
#define _o           printf("1\n")
#define stree        long long lft=node<<1,rht=(node<<1)|1,mid=(s+e)>>1
#define snode        long long s,long long e,long long node
#define slft         s,mid,lft
#define srht         mid+1,e,rht
#define sin()        if(S<=s&&e<=E)
#define sout()       if(S>e||s>E)
#define mod          1000000007
#define read()       freopen("in.txt","r",stdin)
#define write()      freopen("out.txt","w",stdout)
#define sfl(x)       scanf("%I64d",&x)
#define sfll(x,y)    scanf("%I64d %I64d",&x,&y)
#define sflll(x,y,z) scanf("%I64d %I64d %I64d",&x,&y,&z)
#define pfl(x)       printf("%I64d",x)
#define pfll(x,y)    printf("%I64d %I64d",x,y)
#define pflll(x,y,z) printf("%I64d %I64d %I64d",x,y,z)
#define xx           200000

typedef long long ll;
typedef pair<long long,long long> pll;

vector<int>vec[xx+10],t;
bool vst[xx+10];

bool dfs(int cur){
    if(vst[cur]) return false;
    vst[cur]=true;
    t.push_back(cur);
    for(int nxt:vec[cur]) if(dfs(nxt)) t.push_back(cur);
    return true;
}

main(){
    int n,m,k;
    int u,v;
    scanf("%d %d %d",&n,&m,&k);
    while(m--){
        scanf("%d %d",&u,&v);
        vec[u].push_back(v);
        vec[v].push_back(u);
    }
    dfs(1);
    m=t.size();
    int x=m/k;
    int y=m%k;
    int ix=0;

    fi(i,1,k){
       u=x+(y!=0);
       cout<<u;
       fr(j,x) cout<<" "<<t[ix++];
       if(y) {
            cout<<" "<<t[ix++];
            y--;
       }
       _;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sd second
#define y1 koxuixeo
#define pb push_back
const int N=2e5;
const int oo=1e9+5;
int du[]={-1,0,0,1};
int dv[]={0,-1,1,0};
const long long mod=1e9+7;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
long long sqr(long long x) {return x*x;}

int n,m,k;
vector<int> a[N+5],q;
bool vis[N+5];
void dfs(int u)
{
    q.push_back(u);
    vis[u]=true;
    for (int i=0;i<a[u].size();i++)
    {
        int v=a[u][i];
        if (vis[v]) continue;
        dfs(v);
        q.push_back(u);
    }
}
int main()
{
	//freopen("Underground Lab.inp","r",stdin);
	//freopen("Underground Lab.out","w",stdout);
	ios_base::sync_with_stdio(false);
    cin>>n>>m>>k;
    for (int i=1;i<=m;i++)
    {
        int u,v;
        cin>>u>>v;
        a[u].push_back(v);
        a[v].push_back(u);
    }
    dfs(1);
    int lm=(2*n-1)/k+1;
    int vt=0,num=0;
    while (vt<q.size())
    {
        if (vt+lm-1<q.size()) cout<<lm<<" "; else cout<<q.size()-vt<<" ";
        int i;
        for (i=vt;i<=vt+lm-1 && i<q.size();i++) cout<<q[i]<<" ";
        cout<<endl;
        vt=i;
        num++;
    }
    for (int i=num+1;i<=k;i++) cout<<1<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sd second
#define y1 koxuixeo
#define pb push_back
const int N=1e5;
const int oo=1e9+5;
int du[]={-1,0,0,1};
int dv[]={0,-1,1,0};
const long long mod=1e9+7;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
long long sqr(long long x) {return x*x;}

int n,m,k;
vector<int> a[N+5],q;
bool vis[N+5];
void dfs(int u)
{
    q.push_back(u);
    vis[u]=true;
    for (int i=0;i<a[u].size();i++)
    {
        int v=a[u][i];
        if (vis[v]) continue;
        dfs(v);
        q.push_back(u);
    }
}
int main()
{
	//freopen("Underground Lab.inp","r",stdin);
	//freopen("Underground Lab.out","w",stdout);
	ios_base::sync_with_stdio(false);
    cin>>n>>m>>k;
    for (int i=1;i<=m;i++)
    {
        int u,v;
        cin>>u>>v;
        a[u].push_back(v);
        a[v].push_back(u);
    }
    dfs(1);
    int lm=(2*n-1)/k+1;
    int vt=0;
    while (vt<q.size())
    {
        if (vt+lm<q.size()) cout<<lm<<" "; else cout<<q.size()-vt<<" ";
        int i;
        for (i=vt;i<=vt+lm-1 && i<q.size();i++) cout<<q[i]<<" ";
        cout<<endl;
        vt=i;
    }
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sd second
#define y1 koxuixeo
#define pb push_back
const int N=2e5;
const int oo=1e9+5;
int du[]={-1,0,0,1};
int dv[]={0,-1,1,0};
const long long mod=1e9+7;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
long long sqr(long long x) {return x*x;}

int n,m,k;
vector<int> a[N+5],q;
bool vis[N+5];
void dfs(int u)
{
    q.push_back(u);
    vis[u]=true;
    for (int i=0;i<a[u].size();i++)
    {
        int v=a[u][i];
        if (vis[v]) continue;
        dfs(v);
        q.push_back(u);
    }
}
int main()
{
	//freopen("Underground Lab.inp","r",stdin);
	//freopen("Underground Lab.out","w",stdout);
	ios_base::sync_with_stdio(false);
    cin>>n>>m>>k;
    for (int i=1;i<=m;i++)
    {
        int u,v;
        cin>>u>>v;
        a[u].push_back(v);
        a[v].push_back(u);
    }
    dfs(1);
    int lm=(2*n-1)/k+1;
    int vt=0;
    while (vt<q.size())
    {
        if (vt+lm-1<q.size()) cout<<lm<<" "; else cout<<q.size()-vt<<" ";
        int i;
        for (i=vt;i<=vt+lm-1 && i<q.size();i++) cout<<q[i]<<" ";
        cout<<endl;
        vt=i;
    }
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sd second
#define y1 koxuixeo
#define pb push_back
const int N=2e5;
const int oo=1e9+5;
int du[]={-1,0,0,1};
int dv[]={0,-1,1,0};
const long long mod=1e9+7;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
long long sqr(long long x) {return x*x;}

int n,m,k;
vector<int> a[N+5],q;
bool vis[N+5];
void dfs(int u)
{
    q.push_back(u);
    vis[u]=true;
    for (int i=0;i<a[u].size();i++)
    {
        int v=a[u][i];
        if (vis[v]) continue;
        dfs(v);
        q.push_back(u);
    }
}
int main()
{
	//freopen("Underground Lab.inp","r",stdin);
	//freopen("Underground Lab.out","w",stdout);
	ios_base::sync_with_stdio(false);
    cin>>n>>m>>k;
    for (int i=1;i<=m;i++)
    {
        int u,v;
        cin>>u>>v;
        a[u].push_back(v);
        a[v].push_back(u);
    }
    dfs(1);
    int lm=(2*n-1)/k+1;
    int vt=0,num=0;
    while (vt<q.size())
    {
        if (vt+lm-1<q.size()) cout<<lm<<" "; else cout<<q.size()-vt<<" ";
        int i;
        for (i=vt;i<=vt+lm-1 && i<q.size();i++) cout<<q[i]<<" ";
        cout<<endl;
        vt=i;
        num++;
    }
    for (int i=num+1;i<=k;i++) cout<<1<<" "<<1<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sd second
#define y1 koxuixeo
#define pb push_back
const int N=1e5;
const int oo=1e9+5;
int du[]={-1,0,0,1};
int dv[]={0,-1,1,0};
const long long mod=1e9+7;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
long long sqr(long long x) {return x*x;}

int n,m,k;
vector<int> a[N+5],q;
bool vis[N+5];
void dfs(int u)
{
    q.push_back(u);
    vis[u]=true;
    for (int i=0;i<a[u].size();i++)
    {
        int v=a[u][i];
        if (vis[v]) continue;
        dfs(v);
        q.push_back(u);
    }
}
int main()
{
	//freopen("Underground Lab.inp","r",stdin);
	//freopen("Underground Lab.out","w",stdout);
	ios_base::sync_with_stdio(false);
    cin>>n>>m>>k;
    for (int i=1;i<=m;i++)
    {
        int u,v;
        cin>>u>>v;
        a[u].push_back(v);
        a[v].push_back(u);
    }
    dfs(1);
    int lm=2*n/k;
    int vt=0;
    while (vt<q.size())
    {
        if (vt+lm<q.size()) cout<<lm<<" "; else cout<<q.size()-vt<<" ";
        int i;
        for (i=vt;i<=vt+lm-1 && i<q.size();i++) cout<<q[i]<<" ";
        cout<<endl;
        vt=i;
    }
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sd second
#define y1 koxuixeo
#define pb push_back
const int N=2e5;
const int oo=1e9+5;
int du[]={-1,0,0,1};
int dv[]={0,-1,1,0};
const long long mod=1e9+7;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
long long sqr(long long x) {return x*x;}

int n,m,k;
vector<int> a[N+5],q;
bool vis[N+5];
void dfs(int u)
{
    q.push_back(u);
    vis[u]=true;
    for (int i=0;i<a[u].size();i++)
    {
        int v=a[u][i];
        if (vis[v]) continue;
        dfs(v);
        q.push_back(u);
    }
}
int main()
{
	//freopen("Underground Lab.inp","r",stdin);
	//freopen("Underground Lab.out","w",stdout);
	ios_base::sync_with_stdio(false);
    cin>>n>>m>>k;
    for (int i=1;i<=m;i++)
    {
        int u,v;
        cin>>u>>v;
        a[u].push_back(v);
        a[v].push_back(u);
    }
    dfs(1);
    int lm=(2*n-1)/k+1;
    int vt=0;
    while (vt<q.size())
    {
        if (vt+lm<q.size()) cout<<lm<<" "; else cout<<q.size()-vt<<" ";
        int i;
        for (i=vt;i<=vt+lm-1 && i<q.size();i++) cout<<q[i]<<" ";
        cout<<endl;
        vt=i;
    }
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
struct node{
	int to,next;
}e[500050];
int vis[500050];
int cnt,head[500050];
void add(int u,int v){
	++cnt; e[cnt].to=v;
	e[cnt].next=head[u];
	head[u]=cnt;
}
int tot,id[500050],q[500050],gs;
void pre(int u,int fa){
	q[++gs]=u; vis[u]=1;
	for(int i=head[u];i;i=e[i].next){
		int v=e[i].to;
		if(v==fa) continue;
		if(vis[v]) continue;
		pre(v,u);
		q[++gs]=u;
	}
}
int main(){
	int n,m,k; cin>>n>>m>>k;
	for(int i=1;i<=m;i++){
		int x,y; cin>>x>>y;
		add(x,y); add(y,x);
	}
	pre(1,0);
//	cout<<gs<<endl;
	 int kk=0;
	int ds=(2*n+k-1)/k;
	while(k--){
		int cd=min(gs,ds);
		if(cd==0){
			puts("1 1"); continue;
		}
		cout<<cd<<" ";
		for(int i=1;i<=cd && gs;i++,gs--) cout<<q[gs]<<" ";
		cout<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
struct node{
	int to,next;
}e[500050];
int vis[500050];
int cnt,head[500050];
void add(int u,int v){
	++cnt; e[cnt].to=v;
	e[cnt].next=head[u];
	head[u]=cnt;
}
int tot,id[500050],q[500050],gs;
void pre(int u,int fa){
	q[++gs]=u; vis[u]=1;
	for(int i=head[u];i;i=e[i].next){
		int v=e[i].to;
		if(v==fa) continue;
		if(vis[v]) continue;
		pre(v,u);
		q[++gs]=u;
	}
}
int main(){
	int n,m,k; cin>>n>>m>>k;
	for(int i=1;i<=m;i++){
		int x,y; cin>>x>>y;
		add(x,y); add(y,x);
	}
	pre(1,0);
//	cout<<gs<<endl;
	 int kk=0;
	int ds=(2*n+k-1)/k;
	while(k--){
		int cd=min(gs,ds);
		if(cd<=0) return puts("haha"),0;
		cout<<cd<<" ";
		for(int i=1;i<=cd && gs;i++,gs--) cout<<q[gs]<<" ";
		cout<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
struct node{
	int to,next;
}e[500050];
int cnt,head[500050];
void add(int u,int v){
	++cnt; e[cnt].to=v;
	e[cnt].next=head[u];
	head[u]=cnt;
}
int tot,id[500050],q[500050],gs;
void pre(int u,int fa){
	q[++gs]=u;
	for(int i=head[u];i;i=e[i].next){
		int v=e[i].to;
		if(v==fa) continue;
		pre(v,u);
		q[++gs]=u;
	}
}
int main(){
	int n,m,k; cin>>n>>m>>k;
	for(int i=1;i<=m;i++){
		int x,y; cin>>x>>y;
		add(x,y); add(y,x);
	}
	pre(1,0);
//	cout<<gs<<endl;
	int ds=ceil(2*n/k); int kk=0;  int qx=1;
//	cout<<(2*n+k-1)/k<<endl;
	while(k--){
		int cd=min(gs,ds);
		cout<<cd<<" ";
		for(int i=1;i<=cd && gs;i++,gs--) cout<<q[gs]<<" ";
		cout<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
struct node{
	int to,next;
}e[500050];
int vis[500050];
int cnt,head[500050];
void add(int u,int v){
	++cnt; e[cnt].to=v;
	e[cnt].next=head[u];
	head[u]=cnt;
}
int tot,id[500050],q[500050],gs;
void pre(int u,int fa){
	q[++gs]=u; vis[u]=1;
	for(int i=head[u];i;i=e[i].next){
		int v=e[i].to;
		if(v==fa) continue;
		if(vis[v]) continue;
		pre(v,u);
		q[++gs]=u;
	}
}
int main(){
	int n,m,k; cin>>n>>m>>k;
	for(int i=1;i<=m;i++){
		int x,y; cin>>x>>y;
		add(x,y); add(y,x);
	}
	pre(1,0);
//	cout<<gs<<endl;
	 int kk=0;
	int ds=(2*n+k-1)/k; int sj=gs/k;
	while(k--){
		int cd=min(gs,min(sj,ds));
		cout<<cd<<" ";
		if(cd<=0) continue;
		for(int i=1;i<=cd && gs;i++,gs--) cout<<q[gs]<<" ";
		cout<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
struct node{
	int to,next;
}e[500050];
int vis[500050];
int cnt,head[500050];
inline int read(){
	int k=0; int f=1; char ch=getchar();
	while(!isdigit(ch)){if(ch=='-') f=-1; ch=getchar();}
	while(isdigit(ch)){k=(k<<1)+(k<<3)+(ch^48);ch=getchar();}
	return k*f;
}
void add(int u,int v){
	++cnt; e[cnt].to=v;
	e[cnt].next=head[u];
	head[u]=cnt;
}
int tot,id[500050],q[500050],gs;
void pre(int u,int fa){
	q[++gs]=u; vis[u]=1;
	for(int i=head[u];i;i=e[i].next){
		int v=e[i].to;
		if(v==fa) continue;
		if(vis[v]) continue;
		pre(v,u);
		q[++gs]=u;
	}
}
int main(){
	int n,m,k; n=read(); m=read(); k=read();
	for(int i=1;i<=m;i++){
		int x,y;
		x=read(); y=read();
		add(x,y); add(y,x);
	}
	pre(1,0);
//	cout<<gs<<endl;
	 int kk=0;
	int ds=(2*n+k-1)/k;
	while(k--){
		int cd=min(gs,ds);
		if(cd==0){
			puts("1 1"); continue;
		}
		cout<<cd<<" ";
		for(int i=1;i<=cd && gs;i++,gs--) cout<<q[gs]<<" ";
		cout<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
struct node{
	int to,next;
}e[500050];
int vis[500050];
int cnt,head[500050];
void add(int u,int v){
	++cnt; e[cnt].to=v;
	e[cnt].next=head[u];
	head[u]=cnt;
}
int tot,id[500050],q[500050],gs;
void pre(int u,int fa){
	q[++gs]=u; vis[u]=1;
	for(int i=head[u];i;i=e[i].next){
		int v=e[i].to;
		if(v==fa) continue;
		if(vis[v]) continue;
		pre(v,u);
		q[++gs]=u;
	}
}
int main(){
	int n,m,k; cin>>n>>m>>k;
	for(int i=1;i<=m;i++){
		int x,y; cin>>x>>y;
		add(x,y); add(y,x);
	}
	pre(1,0);
//	cout<<gs<<endl;
	 int kk=0;
	int ds=(2*n+k-1)/k;
	while(k--){
		int cd=min(gs,ds);
		if(cd<=0) break;
		cout<<cd<<" ";
		for(int i=1;i<=cd && gs;i++,gs--) cout<<q[gs]<<" ";
		cout<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
struct node{
	int to,next;
}e[500050];
int vis[500050];
int cnt,head[500050];
void add(int u,int v){
	++cnt; e[cnt].to=v;
	e[cnt].next=head[u];
	head[u]=cnt;
}
int tot,id[500050],q[500050],gs;
void pre(int u,int fa){
	q[++gs]=u; vis[u]=1;
	for(int i=head[u];i;i=e[i].next){
		int v=e[i].to;
		if(v==fa) continue;
		if(vis[v]) continue;
		pre(v,u);
		q[++gs]=u;
	}
}
int main(){
	int n,m,k; cin>>n>>m>>k;
	for(int i=1;i<=m;i++){
		int x,y; cin>>x>>y;
		add(x,y); add(y,x);
	}
	pre(1,0);
//	cout<<gs<<endl;
	 int kk=0;
	int ds=(2*n+k-1)/k;
	while(k--){
		int cd=min(gs,ds);
		cout<<cd<<" ";
		for(int i=1;i<=cd && gs;i++,gs--) cout<<q[gs]<<" ";
		cout<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
struct node{
	int to,next;
}e[500050];
int vis[500050];
int cnt,head[500050];
void add(int u,int v){
	++cnt; e[cnt].to=v;
	e[cnt].next=head[u];
	head[u]=cnt;
}
int tot,id[500050],q[500050],gs;
void pre(int u,int fa){
	q[++gs]=u; vis[u]=1;
	for(int i=head[u];i;i=e[i].next){
		int v=e[i].to;
		if(v==fa) continue;
		if(vis[v]) continue;
		pre(v,u);
		q[++gs]=u;
	}
}
int main(){
	int n,m,k; cin>>n>>m>>k;
	for(int i=1;i<=m;i++){
		int x,y; cin>>x>>y;
		add(x,y); add(y,x);
	}
	pre(1,0);
//	cout<<gs<<endl;
	int ds=ceil(2*n/k); int kk=0;  int qx=1;
//	cout<<(2*n+k-1)/k<<endl;
	while(k--){
		int cd=min(gs,ds);
		cout<<cd<<" ";
		for(int i=1;i<=cd && gs;i++,gs--) cout<<q[gs]<<" ";
		cout<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
const int MAXN = 400005;
template <typename T> void chkmax(T &x, T y) {x = max(x, y); }
template <typename T> void chkmin(T &x, T y) {x = min(x, y); }
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
template <typename T> void write(T x) {
	if (x < 0) x = -x, putchar('-');
	if (x > 9) write(x / 10);
	putchar(x % 10 + '0');
}
template <typename T> void writeln(T x) {
	write(x);
	puts("");
}
int n, m, k;
int f[MAXN];
int len, ans[MAXN];
vector <int> a[MAXN];
int F(int x) {
	if (f[x] == x) return x;
	else return f[x] = F(f[x]);
}
void work(int pos, int fa) {
	ans[++len] = pos;
	for (unsigned i = 0; i < a[pos].size(); i++)
		if (a[pos][i] != fa) {
			work(a[pos][i], pos);
			ans[++len] = pos;
		}
}
int main() {
	read(n), read(m), read(k);
	for (int i = 1; i <= n; i++)
		f[i] = i;
	for (int i = 1; i <= m; i++) {
		int x, y; read(x), read(y);
		if (F(x) != F(y)) {
			a[x].push_back(y);
			a[y].push_back(x);
			f[F(x)] = F(y);
		}
	}
	work(1, 0);
	int limit = min(2 * n / k + (2 * n % k != 0), len), now = 0;
	for (int i = 1; i <= k; i++) {
		int r = min(len, limit + now);
		int l = r - limit + 1;
		printf("%d ", limit);
		for (int j = l; j <= r; j++)
			printf("%d ", ans[j]);
		printf("\n");
		now = r;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 200005, M = (N << 1);
int to[M], nxt[M], euler[M], fir[N], F[N], n, m, k, ecnt = 0, idx = 0;
template <class T> void rd(T &x) {
	char c = getchar(); int f = 1; x = 0;
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -1;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
int find(int u) {return F[u] = F[u] == u ? u : find(F[u]);}
void ae(int u, int v) {to[++ecnt] = v; nxt[ecnt] = fir[u]; fir[u] = ecnt;}
void dfs(int u, int f) {
	int i; euler[++idx] = u;
	for (i = fir[u]; i; i = nxt[i]) {
		int v = to[i];
		if (v != f) dfs(v, u), euler[++idx] = u;
	}
}
int main() {
	int i, j, lim, cur;
	rd(n); rd(m); rd(k);
	for (i = 1; i <= n; ++i) F[i] = i;
	for (i = 1; i <= m; ++i) {
		int u, v, fu, fv; rd(u); rd(v);
		fu = find(u); fv = find(v);
		if (fu != fv) F[fu] = fv, ae(u, v), ae(v, u);
	}
	dfs(1, 0); lim = min(2 * n / k + (2 * n % k != 0), idx), cur = 0;
	for (i = 1; i <= k; ++i) {
		int l, r; r = min(idx, lim + cur); l = r - lim + 1;
		printf("%d ", lim); cur = r;
		for (j = l; j <= r; ++j) printf("%d ", euler[j]); printf("\n");
	}
	return 0;
}


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

#define LL      long long int
#define ULL     unsigned long long
#define lc      idx * 2
#define rc      lc | 1
#define pb      push_back
#define pf      push_front
#define S       second
#define F       first
#define mp      make_pair
#define ios     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

const LL  INF = 98769876987698889LL;
const int dx8[] = {1, 1, 0, -1, -1, -1, 0,1};
const int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dx4[] = {0, 0, 1 , -1};
const int dy4[] = {1, -1, 0, 0};

const int MOD = 1e9 + 7;
const int MODB = 1e9 + 9;

const int N = 2e5 + 5;
const int SN = 5e5;

//onst int N = 2e5 + 5;
vector<int> G[N];
int vis[N];
vector<int> ans[N];
int cur = 0;
int n, m, k;
LL mx;

void dfs(int x)
{
    vis[x] = 1;
    ans[cur].pb(x);

    int sz = ans[cur].size();
    if(sz == mx)
    {
        cur++;
    }

    for(auto ka: G[x])
    {
        if(!vis[ka])
        {
            //cout << ans[cur][ans[cur].size() - 1] << " ";
            dfs(ka);
            ans[cur].pb(x);//cout << ans[cur][ans[cur].size() - 1] << " ";
            int szA = ans[cur].size();
            if(szA == mx)++cur;
        }
    }
}

int main()
{
    ios;
    cin >> n >> m >> k;

    mx = (ceil)((2.0 * 1.0 * n)/(1.0 * k));
   // cout << mx << endl;
    while(m--)
    {
        int x, y;
        cin >> x >> y;
        G[x].pb(y);
        G[y].pb(x);
    }

    dfs(1);
    for(int i = 0; i < k; i++)
    {
        //cout << cur << endl;
        if(ans[i].size() == 0)
        {
            cout << 1 << " " << 1 << endl;
        }
        else
        {
            cout << ans[i].size() << " ";
            for(auto f: ans[i])cout << f << " ";
            cout << endl;
        }
    }

}


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

#define LL      long long int
#define ULL     unsigned long long
#define lc      idx * 2
#define rc      lc | 1
#define pb      push_back
#define pf      push_front
#define S       second
#define F       first
#define mp      make_pair
#define ios     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

const LL  INF = 98769876987698889LL;
const int dx8[] = {1, 1, 0, -1, -1, -1, 0,1};
const int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dx4[] = {0, 0, 1 , -1};
const int dy4[] = {1, -1, 0, 0};

const int MOD = 1e9 + 7;
const int MODB = 1e9 + 9;

const int N = 2e5 + 5;
LL cnt = 0;
const int SN = 5e5;

//onst int N = 2e5 + 5;
vector<int> G[N];
int vis[N];
vector<int> ans[N];
int cur = 0;
int n, m, k;
LL mx;

void dfs(int x)
{
    vis[x] = 1;
    ans[cur].pb(x);
    cnt++;
    int sz = ans[cur].size();
    if(sz == mx)
    {
        cur++;
    }

    for(auto ka: G[x])
    {
        if(!vis[ka])
        {
            //cout << ans[cur][ans[cur].size() - 1] << " ";
            dfs(ka);
            ans[cur].pb(x);//cout << ans[cur][ans[cur].size() - 1] << " ";
            cnt++;
            int szA = ans[cur].size();
            if(szA == mx)++cur;
        }
    }
}

int main()
{
    ios;
    cin >> n >> m >> k;

    mx = (ceil)((2.0 * 1.0 * n)/(1.0 * k));
   // cout << mx << endl;
    while(m--)
    {
        int x, y;
        cin >> x >> y;
        G[x].pb(y);
        G[y].pb(x);
    }

    dfs(1);

    assert((cnt == (2 * n - 1)));
    for(int i = 0; i < k; i++)
    {
        //cout << cur << endl;
        if(ans[i].size() == 0)
        {
            cout << 1 << " " << 1 << endl;
        }
        else
        {
            cout << ans[i].size() << " ";
            for(auto f: ans[i])cout << f << " ";
            cout << endl;
        }
    }

}


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

#define LL      long long int
#define ULL     unsigned long long
#define lc      idx * 2
#define rc      lc | 1
#define pb      push_back
#define pf      push_front
#define S       second
#define F       first
#define mp      make_pair
#define ios     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

const LL  INF = 98769876987698889LL;
const int dx8[] = {1, 1, 0, -1, -1, -1, 0,1};
const int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dx4[] = {0, 0, 1 , -1};
const int dy4[] = {1, -1, 0, 0};

const int MOD = 1e9 + 7;
const int MODB = 1e9 + 9;

const int N = 2e5 + 5;
const int SN = 5e5;

//onst int N = 2e5 + 5;
vector<int> G[N];
int vis[N];
vector<int> ans[N];
int cur = 0;
int n, m, k;
LL mx;

void dfs(int x)
{
    vis[x] = 1;
    ans[cur].pb(x);

    int sz = ans[cur].size();
    if(sz == mx)
    {
        cur++;
    }

    for(auto ka: G[x])
    {
        if(!vis[ka])
        {
            //cout << ans[cur][ans[cur].size() - 1] << " ";
            dfs(ka);
            ans[cur].pb(x);//cout << ans[cur][ans[cur].size() - 1] << " ";
            int szA = ans[cur].size();
            if(szA == mx)++cur;
        }
    }
}

int main()
{
    ios;
    cin >> n >> m >> k;

    mx = (ceil)(1.0 * 2.0 * n)/(1.0 * k);

    while(m--)
    {
        int x, y;
        cin >> x >> y;
        G[x].pb(y);
        G[y].pb(x);
    }

    dfs(1);
    for(int i = 0; i < k; i++)
    {
        //cout << cur << endl;
        if(ans[i].size() == 0)
        {
            cout << 1 << " " << 1 << endl;
        }
        else
        {
            cout << ans[i].size() << " ";
            for(auto f: ans[i])cout << f << " ";
            cout << endl;
        }
    }

}


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

#define LL      long long int
#define ULL     unsigned long long
#define lc      idx * 2
#define rc      lc | 1
#define pb      push_back
#define pf      push_front
#define S       second
#define F       first
#define mp      make_pair
#define ios     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

const LL  INF = 98769876987698889LL;
const int dx8[] = {1, 1, 0, -1, -1, -1, 0,1};
const int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dx4[] = {0, 0, 1 , -1};
const int dy4[] = {1, -1, 0, 0};

const int MOD = 1e9 + 7;
const int MODB = 1e9 + 9;

const int N = 2e5 + 5;
const int SN = 5e5;

//onst int N = 2e5 + 5;
vector<int> G[N];
int vis[N];
vector<int> ans[N];
int cur = 0;
int n, m, k;
LL mx;

void dfs(int x)
{
    vis[x] = 1;
    ans[cur].pb(x);

    int sz = ans[cur].size();
    if(sz == mx)
    {
        cur++;
    }

    for(auto ka: G[x])
    {
        if(!vis[ka])
        {
            //cout << ans[cur][ans[cur].size() - 1] << " ";
            dfs(ka);
            ans[cur].pb(x);//cout << ans[cur][ans[cur].size() - 1] << " ";
            int szA = ans[cur].size();
            if(szA == mx)++cur;
        }
    }
}

int main()
{
    ios;
    cin >> n >> m >> k;

    mx = (ceil)(n + n + k - 1)/(1.0 * k);
    //cout << mx << endl;
    while(m--)
    {
        int x, y;
        cin >> x >> y;
        G[x].pb(y);
        G[y].pb(x);
    }

    dfs(1);
    for(int i = 0; i < k; i++)
    {
        //cout << cur << endl;
        if(ans[i].size() == 0)
        {
            cout << 1 << " " << 1 << endl;
        }
        else
        {
            cout << ans[i].size() << " ";
            for(auto f: ans[i])cout << f << " ";
            cout << endl;
        }
    }

}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <map>
using namespace std;

const int MAXN = 2e5 + 10;
vector<int> vt[MAXN];
map<pair<int, int>, int> mp;
int vis[MAXN], path[MAXN];
int indx = 0;

void dfs(int x){
    vis[x] = 1;
    path[indx++] = x;
    for(int i = 0; i < vt[x].size(); i++){
        if(!vis[vt[x][i]]){
            vis[vt[x][i]] = 1;
            dfs(vt[x][i]);
            path[indx++] = x;
        }
    }
}

int main(void){
    int n, m, k, x, y;
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 0; i < m; i++){
        scanf("%d%d", &x, &y);
        // if(x == y) continue;
        // if(mp[{x, y}] + mp[{y, x}]) continue;
        vt[x].push_back(y);
        vt[y].push_back(x);
        // mp[{x, y}] = 1;

    }
    dfs(1);
    int pos = 0, cnt = 2 * n / k + ((2 * n % k) ? 1 : 0);
    for(; pos < k; pos++){
        if(indx < 0) break;
        int cc = 0;
        printf("%d ", min(indx, cnt));
        while(cc++ < cnt){
            if(--indx < 0) break;
            printf("%d ", path[indx]);
        }
        puts("");
    }
    for(int i = pos; i < k; i++){
        printf("%d %d\n", 1, 1);
    }
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <map>
using namespace std;

const int MAXN = 2e5 + 10;
vector<int> vt[MAXN];
map<pair<int, int>, int> mp;
int vis[MAXN], path[MAXN << 2];
int indx = 0;

void dfs(int x){
    vis[x] = 1;
    path[++indx] = x;
    for(int i = 0; i < vt[x].size(); i++){
        if(!vis[vt[x][i]]){
            dfs(vt[x][i]);
            path[++indx] = x;
        }
    }
}

int main(void){
    int n, m, k, x, y;
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 0; i < m; i++){
        scanf("%d%d", &x, &y);
        if(x == y) continue;
        if(mp[{x, y}] + mp[{y, x}]) continue;
        vt[x].push_back(y);
        vt[y].push_back(x);
        mp[{x, y}] = 1;

    }
    dfs(1);
    int cnt = (2 * n + k - 1) / k;
    for(int i = 0; i < k; i++){
        int cc = min(cnt, indx);
        if(!cc){
            printf("1 1\n");
            continue;
        }
        printf("%d ", cc);
        for(int j = 0; j < cc && indx; j++,indx--){
            printf("%d ", path[indx]);
        }
        puts("");
    }
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <map>
using namespace std;

const int MAXN = 2e5 + 10;
vector<int> vt[MAXN];
map<pair<int, int>, int> mp;
int vis[MAXN], path[MAXN];
int indx = 0;

void dfs(int x){
    vis[x] = 1;
    path[indx++] = x;
    for(int i = 0; i < vt[x].size(); i++){
        if(!vis[vt[x][i]]){
            vis[vt[x][i]] = 1;
            dfs(vt[x][i]);
            path[indx++] = x;
        }
    }
}

int main(void){
    int n, m, k, x, y;
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 1; i < n; i++){
        scanf("%d%d", &x, &y);
        if(x == y) continue;
        if(mp[{x, y}] + mp[{y, x}]) continue;
        vt[x].push_back(y);
        vt[y].push_back(x);
        mp[{x, y}] = 1;

    }
    dfs(1);
    int pos = 0, cnt = 2 * n / k;
    for(; pos < k; pos++){
        if(indx < 0) break;
        int cc = 0;
        printf("%d ", min(indx, cnt));
        while(cc++ < cnt){
            if(--indx < 0) break;
            printf("%d ", path[indx]);
        }
        puts("");
    }
    for(int i = pos; i < k; i++){
        printf("%d %d\n", 1, 1);
    }
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <map>
using namespace std;

const int MAXN = 2e5 + 10;
vector<int> vt[MAXN];
map<pair<int, int>, int> mp;
int vis[MAXN], path[MAXN << 2];
int indx = 0;

void dfs(int x){
    vis[x] = 1;
    path[++indx] = x;
    for(int i = 0; i < vt[x].size(); i++){
        if(!vis[vt[x][i]]){
            dfs(vt[x][i]);
            path[++indx] = x;
        }
    }
}

int main(void){
    int n, m, k, x, y;
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 0; i < m; i++){
        scanf("%d%d", &x, &y);
        // if(x == y) continue;
        // if(mp[{x, y}] + mp[{y, x}]) continue;
        vt[x].push_back(y);
        vt[y].push_back(x);
        // mp[{x, y}] = 1;

    }
    dfs(1);
    int cnt = (2 * n + k - 1) / k;
    for(int i = 0; i < k; i++){
        int cc = min(cnt, indx);
        if(!cc){
            printf("1 1\n");
            continue;
        }
        printf("%d ", cc);
        for(int j = 0; j < cc && indx; j++,indx--){
            printf("%d ", path[indx]);
        }
        puts("");
    }
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <map>
using namespace std;

const int MAXN = 2e5 + 10;
vector<int> vt[MAXN];
map<pair<int, int>, int> mp;
int vis[MAXN], path[MAXN];
int indx = 0;

void dfs(int x){
    vis[x] = 1;
    path[++indx] = x;
    for(int i = 0; i < vt[x].size(); i++){
        if(!vis[vt[x][i]]){
            dfs(vt[x][i]);
            path[++indx] = x;
        }
    }
}

int main(void){
    int n, m, k, x, y;
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 0; i < m; i++){
        scanf("%d%d", &x, &y);
        // if(x == y) continue;
        // if(mp[{x, y}] + mp[{y, x}]) continue;
        vt[x].push_back(y);
        vt[y].push_back(x);
        // mp[{x, y}] = 1;

    }
    dfs(1);
    int cnt = (2 * n + k - 1) / k;
    for(int i = 0; i < k; i++){
        int cc = min(cnt, indx);
        if(!cc){
            printf("1 1\n");
            continue;
        }
        printf("%d ", cc);
        for(int j = 0; j < cc && indx; j++,indx--){
            printf("%d ", path[indx]);
        }
        puts("");
    }
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <map>
using namespace std;

const int MAXN = 2e5 + 10;
vector<int> vt[MAXN];
map<pair<int, int>, int> mp;
int vis[MAXN], path[MAXN];
int indx = 0;

void dfs(int x){
    vis[x] = 1;
    path[++indx] = x;
    for(int i = 0; i < vt[x].size(); i++){
        if(!vis[vt[x][i]]){
            vis[vt[x][i]] = 1;
            dfs(vt[x][i]);
            path[++indx] = x;
        }
    }
}

int main(void){
    int n, m, k, x, y;
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 0; i < m; i++){
        scanf("%d%d", &x, &y);
        // if(x == y) continue;
        // if(mp[{x, y}] + mp[{y, x}]) continue;
        vt[x].push_back(y);
        vt[y].push_back(x);
        // mp[{x, y}] = 1;

    }
    dfs(1);
    int cnt = (2 * n + k - 1) / k;
    for(int i = 0; i < k; i++){
        int cc = min(cnt, indx);
        if(!cc){
            printf("1 1\n");
            continue;
        }
        printf("%d ", cc);
        for(int j = 0; j < cc && indx; j++,indx--){
            printf("%d ", path[indx]);
        }
        puts("");
    }
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <map>
using namespace std;

const int MAXN = 2e5 + 10;
vector<int> vt[MAXN];
map<pair<int, int>, int> mp;
int vis[MAXN], path[MAXN];
int indx = 0;

void dfs(int x){
    vis[x] = 1;
    path[indx++] = x;
    for(int i = 0; i < vt[x].size(); i++){
        if(!vis[vt[x][i]]){
            vis[vt[x][i]] = 1;
            dfs(vt[x][i]);
            path[indx++] = x;
        }
    }
}

int main(void){
    int n, m, k, x, y;
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 0; i < m; i++){
        scanf("%d%d", &x, &y);
        if(x == y) continue;
        if(mp[{x, y}] + mp[{y, x}]) continue;
        vt[x].push_back(y);
        vt[y].push_back(x);
        mp[{x, y}] = 1;

    }
    dfs(1);
    int pos = 0, cnt = 2 * n / k;
    for(; pos < k; pos++){
        if(indx < 0) break;
        int cc = 0;
        printf("%d ", min(indx, cnt));
        while(cc++ < cnt){
            if(--indx < 0) break;
            printf("%d ", path[indx]);
        }
        puts("");
    }
    for(int i = pos; i < k; i++){
        printf("%d %d\n", 1, 1);
    }
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <map>
using namespace std;

const int MAXN = 2e5 + 10;
vector<int> vt[MAXN];
map<pair<int, int>, int> mp;
int vis[MAXN], path[MAXN];
int indx = 0;

void dfs(int x){
    vis[x] = 1;
    path[indx++] = x;
    for(int i = 0; i < vt[x].size(); i++){
        if(!vis[vt[x][i]]){
            vis[vt[x][i]] = 1;
            dfs(vt[x][i]);
            path[indx++] = x;
        }
    }
}

int main(void){
    int n, m, k, x, y;
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 0; i < m; i++){
        scanf("%d%d", &x, &y);
        if(x == y) continue;
        if(mp[{x, y}] + mp[{y, x}]) continue;
        vt[x].push_back(y);
        vt[y].push_back(x);
        mp[{x, y}] = 1;

    }
    dfs(1);
    int pos = 0, cnt = 2 * n / k + ((2 * n % k) ? 1 : 0);
    for(; pos < k; pos++){
        if(indx < 0) break;
        int cc = 0;
        printf("%d ", min(indx, cnt));
        while(cc++ < cnt){
            if(--indx < 0) break;
            printf("%d ", path[indx]);
        }
        puts("");
    }
    for(int i = pos; i < k; i++){
        printf("%d %d\n", 1, 1);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
vector <int> g[maxn];
vector <int> order;
bool vis[maxn];

void dfs(int x) {
  vis[x] = true;
  order.push_back(x);
  for(auto i : g[x]) {
    if(vis[i] == false) {
      dfs(i);
      order.push_back(x);
    }
  }
}
int main() {
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  for(int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1);
  vector <int> current;
  int maxSize = (2 * n + k - 1) / k;
  int cnt = 0;
  for(auto i : order) {
    current.push_back(i);
    if(current.size() == maxSize) {
      printf("%d", (int) current.size());
      cnt = cnt + 1;
      for(auto j : current) printf(" %d", j);
      printf("\n");
      current.clear();
    }
  }
  if(current.size() == 0) current.push_back(1);
  while(cnt < k) {
    cnt = cnt + 1;
    printf("%d", (int) current.size());
    for(auto j : current) printf(" %d", j);
    printf("\n");
  }
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int NMAX = 2e5 + 7;

int n, m, k;
vector<int> Tree[NMAX];
int Df[NMAX];

struct DSU
{
    int from[NMAX], sz[NMAX];
    void init(){for(int i = 0; i < NMAX; i++) from[i] = i;}
    int _find(int x){return x == from[x] ? x : from[x] = _find(from[x]);}
    void mrg(int x, int y){from[_find(y)] = from[_find(x)];}
}D;
int cnt;
void Dfs(int cur, int prev)
{
    //put.push_back(cur);
    Df[++cnt] = cur;
    for(int i : Tree[cur])
    {
        if(i == prev) continue;
        Dfs(i, cur);
        //put.push_back(cur);
        Df[++cnt] = cur;
    }
}

int main()
{
    D.init();
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 1; i <= m; i++)
    {
        int x, y; scanf("%d%d", &x, &y);
        if(D._find(x) != D._find(y))
        {
            Tree[x].push_back(y);
            Tree[y].push_back(x);
            D.mrg(x, y);
        }
    }
    //put.push_back(-1);
    cnt = 0;
    Dfs(1, 0);
    //for(int i : put) printf("%d ", i);
    for(int i = 1, num = (2 * n - 1 + k) / k, now = 1; i <= k; i++)
    {
        if(now > cnt) printf("1 1");
        else
        {
            printf("%d ", min(num, cnt - now + 1));
            for(int r = num; r && now <= cnt; --r, ++now) printf("%d ", Df[now]);
            printf("\n");
        }
    }
    return 0;
}
/*
12 11 69
1 2
1 3
1 4
2 5
2 8
5 6
5 7
3 9
3 10
10 11
10 12
*/


#include <bits/stdc++.h>

using namespace std;

const int NMAX = 2e5 + 7;

int n, m, k;
vector<int> Tree[NMAX];
int D[NMAX];

struct DSU
{
    int from[NMAX], sz[NMAX];
    void init(){for(int i = 0; i < NMAX; i++) from[i] = i;}
    int _find(int x){return x == from[x] ? x : from[x] = _find(from[x]);}
    void mrg(int x, int y){from[_find(y)] = from[_find(x)];}
}D;
int cnt;
void Dfs(int cur, int prev)
{
    //put.push_back(cur);
    D[++cnt] = cur;
    for(int i : Tree[cur])
    {
        if(i == prev) continue;
        Dfs(i, cur);
        //put.push_back(cur);
        D[++cnt] = cur;
    }
}

int main()
{
    D.init();
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 1; i <= m; i++)
    {
        int x, y; scanf("%d%d", &x, &y);
        if(D._find(x) != D._find(y))
        {
            Tree[x].push_back(y);
            Tree[y].push_back(x);
            D.mrg(x, y);
        }
    }
    //put.push_back(-1);
    cnt = 0;
    Dfs(1, 0);
    //for(int i : put) printf("%d ", i);
    for(int i = 1, num = (2 * n - 1 + k) / k, now = 1; i <= k; i++)
    {
        if(now > cnt) printf("1 1");
        else
        {
            printf("%d ", min(num, cnt - now + 1));
            for(int r = num; r && now <= cnt; --r, ++now) printf("%d ", D[now]);
            printf("\n");
        }
    }
    return 0;
}
/*
12 11 69
1 2
1 3
1 4
2 5
2 8
5 6
5 7
3 9
3 10
10 11
10 12
*/


#include <bits/stdc++.h>

using namespace std;

const int NMAX = 2e5 + 7;

int n, m, k;
vector<int> Tree[NMAX];
int Df[NMAX];

struct DSU
{
    int from[NMAX], sz[NMAX];
    void init(){for(int i = 0; i < NMAX; i++) from[i] = i;}
    int _find(int x){return x == from[x] ? x : from[x] = _find(from[x]);}
    void mrg(int x, int y){from[_find(y)] = from[_find(x)];}
}D;

void Dfs(int cur, int prev)
{
    //put.push_back(cur);
    Df[++cnt] = cur;
    for(int i : Tree[cur])
    {
        if(i == prev) continue;
        Dfs(i, cur);
        //put.push_back(cur);
        Df[++cnt] = cur;
    }
}

int main()
{
    D.init();
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 1; i <= m; i++)
    {
        int x, y; scanf("%d%d", &x, &y);
        if(D._find(x) != D._find(y))
        {
            Tree[x].push_back(y);
            Tree[y].push_back(x);
            D.mrg(x, y);
        }
    }
    //put.push_back(-1);
    int cnt = 0;
    Dfs(1, 0);
    //for(int i : put) printf("%d ", i);
    for(int i = 1, num = (2 * n - 1 + k) / k, now = 1; i <= k; i++)
    {
        if(now > cnt) printf("1 1");
        else
        {
            printf("%d ", min(num, cnt - now + 1));
            for(int r = num; r && now <= cnt; --r, ++now) printf("%d ", Df[now]);
            printf("\n");
        }
    }
    return 0;
}
/*
12 11 69
1 2
1 3
1 4
2 5
2 8
5 6
5 7
3 9
3 10
10 11
10 12
*/


#include <bits/stdc++.h>

using namespace std;

const int NMAX = 2e5 + 7;

int n, m, k;
vector<int> Tree[NMAX];
int D[NMAX];

struct DSU
{
    int from[NMAX], sz[NMAX];
    void init(){for(int i = 0; i < NMAX; i++) from[i] = i;}
    int _find(int x){return x == from[x] ? x : from[x] = _find(from[x]);}
    void mrg(int x, int y){from[_find(y)] = from[_find(x)];}
}D;

void Dfs(int cur, int prev)
{
    //put.push_back(cur);
    D[++cnt] = cur;
    for(int i : Tree[cur])
    {
        if(i == prev) continue;
        Dfs(i, cur);
        //put.push_back(cur);
        D[++cnt] = cur;
    }
}

int main()
{
    D.init();
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 1; i <= m; i++)
    {
        int x, y; scanf("%d%d", &x, &y);
        if(D._find(x) != D._find(y))
        {
            Tree[x].push_back(y);
            Tree[y].push_back(x);
            D.mrg(x, y);
        }
    }
    //put.push_back(-1);
    int cnt = 0;
    Dfs(1, 0);
    //for(int i : put) printf("%d ", i);
    for(int i = 1, num = (2 * n - 1 + k) / k, now = 1; i <= k; i++)
    {
        if(now > cnt) printf("1 1");
        else
        {
            printf("%d ", min(num, cnt - now + 1));
            for(int r = num; r && now <= cnt; --r, ++now) printf("%d ", D[now]);
            printf("\n");
        }
    }
    return 0;
}
/*
12 11 69
1 2
1 3
1 4
2 5
2 8
5 6
5 7
3 9
3 10
10 11
10 12
*/


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>

const int32_t BUCKET = 316;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t ask(int32_t x, bool remove) {
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	int32_t rem = ask(1, false);
	while(ind < primes.size()) {
		int32_t prevInd = ind, removed = 0;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size()) {
				break;
			}

			removed++;
			ask(primes[ind], true);
			ind++;
		}

		prevInd = ind;

		int32_t currRem = ask(1, false);
		if(currRem != rem - removed) {
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[i], false) == 1) {
					ans *= primes[i];
					break;
				}
			}

			std::cout << "C " << ans << '\n' << std::flush;
			return 0;
		}
	}

	std::cout << ans << '\n';
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>
#include <cassert>

const int32_t BUCKET = 316;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t cntAsked = 0;
int32_t ask(int32_t x, bool remove) {
	cntAsked++;
	assert(cntAsked <= 10000);

	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	int32_t rem = ask(1, false);
	while(ind < primes.size()) {
		int32_t prevInd = ind, removed = 0;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size()) {
				break;
			}

			removed++;
			assert(ask(primes[ind], true) == 1);
			ind++;
		}

		prevInd = ind;

		int32_t currRem = ask(1, false);
		if(currRem != rem - removed) {
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[i], false) != 0) {
					std::cout << "here" << '\n';
					ans *= primes[i];
					break;
				}
			}

			std::cout << "C " << ans << '\n' << std::flush;
			return 0;
		}

		rem = currRem;
	}

	std::cout << "C " << ans << '\n' << std::flush;
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>
#include <cassert>

const int32_t BUCKET = 100;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t cntAsked = 0;
int32_t ask(int32_t x, bool remove) {
	cntAsked++;
	if(cntAsked > 10000) {
		std::cout << x << '\n';
	}
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	if(ans == 1) {
		int32_t rem = ask(1, false);
		while(ind < primes.size()) {
			if(primes[ind] > n / ans) {
				break;
			}

			int32_t prevInd = ind, removed = 0;
			for(int32_t i = 0; i < BUCKET; i++) {
				if(ind == primes.size() || primes[ind] > n / ans) {
					break;
				}

				removed++;
				assert(ask(primes[ind], true) <= 2);
				ind++;
			}

			int32_t currRem = ask(1, false);
			if(currRem != rem - removed) {
				for(int32_t i = prevInd; i < ind; i++) {
					if(ask(primes[i], false) != 0) {
						ans *= primes[i];
						break;
					}
				}

				std::cout << "C " << ans << '\n' << std::flush;
				return 0;
			}

			rem = currRem;
		}

		std::cout << "C " << ans << '\n' << std::flush;
	}
	else {
		while(ind < primes.size()) {
			if(ask(primes[ind], true) == 2) {
				ans *= primes[ind];
				break;
			}

			ind++;
		}

		std::cout << "C " << ans << '\n' << std::flush;
	}
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>
#include <cassert>

const int32_t BUCKET = 316;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t ask(int32_t x, bool remove) {
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	int32_t rem = ask(1, false);
	while(ind < primes.size()) {
		int32_t prevInd = ind, removed = 0;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size()) {
				break;
			}

			removed++;
			assert(ask(primes[ind], true) == 1);
			ind++;
		}

		prevInd = ind;

		int32_t currRem = ask(1, false);
		if(currRem != rem - removed) {
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[i], false) != 0) {
					ans *= primes[i];
					break;
				}
			}

			std::cout << "C " << ans << '\n' << std::flush;
			return 0;
		}

		rem = currRem;
	}

	std::cout << "C " << ans << '\n' << std::flush;
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>
#include <cassert>

const int32_t BUCKET = 97;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t cntAsked = 0;
int32_t ask(int32_t x, bool remove) {
	cntAsked++;
	if(cntAsked > 10000) {
		std::cout << x << '\n';
	}
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}
	}

	int32_t rem = n;
	while(ind < primes.size()) {
		if(primes[ind] > n / ans) {
			break;
		}

		int32_t prevInd = ind, removed = 0;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size() || primes[ind] > n / ans) {
				break;
			}

			removed += ask(primes[ind], true);
			ind++;
		}

		int32_t currRem = ask(1, false);
		if(currRem != rem - removed) {
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[i], false) != 0) {
					ans *= primes[i];
					break;
				}
			}

			break;
		}

		rem = currRem;
	}

	for(int32_t i = 0; i < primes.size(); i++) {
		if(primes[i] * primes[i] > n || primes[i] * ans > n) {
			break;
		}

		int32_t aux = primes[i];
		while(aux * primes[i] <= n) {
			aux *= primes[i];
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}
		}
	}

	std::cout << "C " << ans << '\n' << std::flush;
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>
#include <cassert>

const int32_t BUCKET = 316;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t cntAsked = 0;
int32_t ask(int32_t x, bool remove) {
	cntAsked++;
	if(cntAsked > 10000) {
		std::cout << cntAsked << '\n';
	}
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	int32_t rem = ask(1, false);
	while(ind < primes.size()) {
		int32_t prevInd = ind, removed = 0;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size()) {
				break;
			}

			removed++;
			assert(ask(primes[ind], true) == 1);
			ind++;
		}

		int32_t currRem = ask(1, false);
		if(currRem != rem - removed) {
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[i], false) != 0) {
					ans *= primes[i];
					break;
				}
			}

			std::cout << "C " << ans << '\n' << std::flush;
			return 0;
		}

		rem = currRem;
	}

	std::cout << "C " << ans << '\n' << std::flush;
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>

const int32_t BUCKET = 316;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t ask(int32_t x, bool remove) {
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	int32_t rem = ask(1, false);
	while(ind < primes.size()) {
		int32_t prevInd = ind, removed = 0;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size()) {
				break;
			}

			removed++;
			assert(ask(primes[ind], true) == 1);
			ind++;
		}

		prevInd = ind;

		int32_t currRem = ask(1, false);
		if(currRem != rem - removed) {
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[i], false) != 0) {
					ans *= primes[i];
					break;
				}
			}

			std::cout << "C " << ans << '\n' << std::flush;
			return 0;
		}

		rem = currRem;
	}

	std::cout << "C " << ans << '\n' << std::flush;
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>

const int32_t BUCKET = 316;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t ask(int32_t x, bool remove) {
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	int32_t rem = ask(1, false);
	while(ind < primes.size()) {
		int32_t prevInd = ind, removed = 0;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size()) {
				break;
			}

			removed++;
			ask(primes[ind], true);
			ind++;
		}

		prevInd = ind;

		int32_t currRem = ask(1, false);
		if(currRem != rem - removed) {
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[i], false) == 1) {
					ans *= primes[i];
					break;
				}
			}

			std::cout << "C " << ans << '\n' << std::flush;
			return 0;
		}
	}

	std::cout << "C " << ans << '\n' << std::flush;
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>
#include <cassert>

const int32_t BUCKET = 100;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t cntAsked = 0;
int32_t ask(int32_t x, bool remove) {
	cntAsked++;
	if(cntAsked > 10000) {
		std::cout << x << '\n';
	}
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	if(ans == 1) {
		int32_t rem = ask(1, false);
		while(ind < primes.size()) {
			if(primes[ind] > n / ans) {
				break;
			}

			int32_t prevInd = ind, removed = 0;
			for(int32_t i = 0; i < BUCKET; i++) {
				if(ind == primes.size()) {
					break;
				}

				removed++;
				assert(ask(primes[ind], true) <= 2);
				ind++;
			}

			int32_t currRem = ask(1, false);
			if(currRem != rem - removed) {
				for(int32_t i = prevInd; i < ind; i++) {
					if(ask(primes[i], false) != 0) {
						ans *= primes[i];
						break;
					}
				}

				std::cout << "C " << ans << '\n' << std::flush;
				return 0;
			}

			rem = currRem;
		}

		std::cout << "C " << ans << '\n' << std::flush;
	}
	else {
		while(ind < primes.size()) {
			if(ask(primes[ind], true) == 2) {
				ans *= primes[ind];
				break;
			}

			ind++;
		}

		std::cout << "C " << ans << '\n' << std::flush;
	}
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>
#include <cassert>

const int32_t BUCKET = 316;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t cntAsked = 0;
int32_t ask(int32_t x, bool remove) {
	cntAsked++;
	assert(cntAsked <= 10000);

	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	int32_t rem = ask(1, false);
	while(ind < primes.size()) {
		int32_t prevInd = ind, removed = 0;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size()) {
				break;
			}

			removed++;
			assert(ask(primes[ind], true) == 1);
			ind++;
		}

		prevInd = ind;

		int32_t currRem = ask(1, false);
		if(currRem != rem - removed) {
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[i], false) != 0) {
					ans *= primes[i];
					break;
				}
			}

			std::cout << "C " << ans << '\n' << std::flush;
			return 0;
		}

		rem = currRem;
	}

	std::cout << "C " << ans << '\n' << std::flush;
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>

const int32_t BUCKET = 316;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t ask(int32_t x, bool remove) {
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	int32_t rem = ask(1, false);
	while(ind < primes.size()) {
		int32_t prevInd = ind, removed = 0;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size()) {
				break;
			}

			removed++;
			ask(primes[ind], true);
			ind++;
		}

		prevInd = ind;

		int32_t currRem = ask(1, false);
		if(currRem != rem - removed) {
			std::cout << "here" << '\n';
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[i], false) == 1) {
					ans *= primes[i];
					break;
				}
			}

			std::cout << "C " << ans << '\n' << std::flush;
			return 0;
		}

		rem = currRem;
	}

	std::cout << "C " << ans << '\n' << std::flush;
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>

const int32_t BUCKET = 316;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t ask(int32_t x, bool remove) {
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	int32_t rem = ask(1, false);
	while(ind < primes.size()) {
		int32_t prevInd = ind, removed = 0;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size()) {
				break;
			}

			removed++;
			ask(primes[ind], true);
			ind++;
		}

		prevInd = ind;

		int32_t currRem = ask(1, false);
		if(currRem != rem - removed) {
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[i], false) == 1) {
					ans *= primes[i];
					break;
				}
			}

			std::cout << "C " << ans << '\n' << std::flush;
			return 0;
		}

		rem = currRem;
	}

	std::cout << "C " << ans << '\n' << std::flush;
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>
#include <cassert>

const int32_t BUCKET = 100;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t cntAsked = 0;
int32_t ask(int32_t x, bool remove) {
	cntAsked++;
	if(cntAsked > 10000) {
		std::cout << x << '\n';
	}
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	if(ans == 1) {
		int32_t rem = ask(1, false);
		while(ind < primes.size()) {
			int32_t prevInd = ind, removed = 0;
			for(int32_t i = 0; i < BUCKET; i++) {
				if(ind == primes.size()) {
					break;
				}

				removed++;
				assert(ask(primes[ind], true) <= 2);
				ind++;
			}

			int32_t currRem = ask(1, false);
			if(currRem != rem - removed) {
				for(int32_t i = prevInd; i < ind; i++) {
					if(ask(primes[i], false) != 0) {
						ans *= primes[i];
						break;
					}
				}

				std::cout << "C " << ans << '\n' << std::flush;
				return 0;
			}

			rem = currRem;
		}

		std::cout << "C " << ans << '\n' << std::flush;
	}
	else {
		while(ind < primes.size()) {
			if(ask(primes[ind], true) == 2) {
				ans *= primes[ind];
				break;
			}

			ind++;
		}

		std::cout << "C " << ans << '\n' << std::flush;
	}
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>
#include <cassert>

const int32_t BUCKET = 97;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t cntAsked = 0;
int32_t ask(int32_t x, bool remove) {
	cntAsked++;
	if(cntAsked > 10000) {
		std::cout << x << '\n';
	}
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}
	}

	int32_t rem = ask(1, false);
	while(ind < primes.size()) {
		if(primes[ind] > n / ans) {
			break;
		}

		int32_t prevInd = ind, removed = 0;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size() || primes[ind] > n / ans) {
				break;
			}

			removed += ask(primes[ind], true);
			ind++;
		}

		int32_t currRem = ask(1, false);
		if(currRem != rem - removed) {
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[i], false) != 0) {
					ans *= primes[i];
					break;
				}
			}

			std::cout << "C " << ans << '\n' << std::flush;
			return 0;
		}

		rem = currRem;
	}

	std::cout << "C " << ans << '\n' << std::flush;
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>

const int32_t BUCKET = 316;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t ask(int32_t x, bool remove) {
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	int32_t rem = ask(1, false);
	while(ind < primes.size()) {
		int32_t prevInd = ind;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size()) {
				break;
			}

			ask(primes[ind], true);
			ind++;
		}

		int32_t currRem = ask(1, false);
		if(currRem != rem) {
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[ind], false) == 1) {
					ans *= primes[ind];
					break;
				}
			}

			std::cout << "C " << ans << '\n' << std::flush;
			return 0;
		}
	}

	std::cout << ans << '\n';
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>

const int32_t BUCKET = 316;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t ask(int32_t x, bool remove) {
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	int32_t rem = ask(1, false);
	while(ind < primes.size()) {
		int32_t prevInd = ind;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size()) {
				break;
			}

			ask(primes[ind], true);
			ind++;
		}

		prevInd = ind;

		int32_t currRem = ask(1, false);
		if(currRem != rem) {
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[i], false) == 1) {
					ans *= primes[ind];
					break;
				}
			}

			std::cout << "C " << ans << '\n' << std::flush;
			return 0;
		}
	}

	std::cout << ans << '\n';
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>
#include <cassert>

const int32_t BUCKET = 316;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t cntAsked = 0;
int32_t ask(int32_t x, bool remove) {
	cntAsked++;
	if(cntAsked > 10000) {
		std::cout << cntAsked << '\n';
	}
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	int32_t rem = ask(1, false);
	while(ind < primes.size()) {
		int32_t prevInd = ind, removed = 0;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size()) {
				break;
			}

			removed++;
			assert(ask(primes[ind], true) != 2);
			ind++;
		}

		int32_t currRem = ask(1, false);
		if(currRem != rem - removed) {
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[i], false) != 0) {
					ans *= primes[i];
					break;
				}
			}

			std::cout << "C " << ans << '\n' << std::flush;
			return 0;
		}

		rem = currRem;
	}

	std::cout << "C " << ans << '\n' << std::flush;
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>
#include <cassert>

const int32_t BUCKET = 316;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t cntAsked = 0;
int32_t ask(int32_t x, bool remove) {
	cntAsked++;
	if(cntAsked > 10000) {
		std::cout << cntAsked << '\n';
	}
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	int32_t rem = ask(1, false);
	while(ind < primes.size()) {
		int32_t prevInd = ind, removed = 0;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size()) {
				break;
			}

			removed++;
			assert(ask(primes[ind], true) < 3);
			ind++;
		}

		int32_t currRem = ask(1, false);
		if(currRem != rem - removed) {
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[i], false) != 0) {
					ans *= primes[i];
					break;
				}
			}

			std::cout << "C " << ans << '\n' << std::flush;
			return 0;
		}

		rem = currRem;
	}

	std::cout << "C " << ans << '\n' << std::flush;
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>
#include <cassert>

const int32_t BUCKET = 316;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t cntAsked = 0;
int32_t ask(int32_t x, bool remove) {
	cntAsked++;
	if(cntAsked > 10000) {
		std::cout << cntAsked << '\n';
	}
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	int32_t rem = ask(1, false);
	while(ind < primes.size()) {
		int32_t prevInd = ind, removed = 0;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size()) {
				break;
			}

			removed++;
			ask(primes[ind], true) == 1;
			ind++;
		}

		int32_t currRem = ask(1, false);
		if(currRem != rem - removed) {
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[i], false) != 0) {
					ans *= primes[i];
					break;
				}
			}

			std::cout << "C " << ans << '\n' << std::flush;
			return 0;
		}

		rem = currRem;
	}

	std::cout << "C " << ans << '\n' << std::flush;
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>
#include <cassert>

const int32_t BUCKET = 316;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t cntAsked = 0;
int32_t ask(int32_t x, bool remove) {
	cntAsked++;
	if(cntAsked > 10000) {
		std::cout << cntAsked << '\n';
	}
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	int32_t rem = ask(1, false);
	while(ind < primes.size()) {
		int32_t prevInd = ind, removed = 0;
		for(int32_t i = 0; i < BUCKET; i++) {
			if(ind == primes.size()) {
				break;
			}

			assert((int64_t) primes[ind] * primes[ind] > n);

			removed++;
			assert(ask(primes[ind], true) <= 2);
			ind++;
		}

		int32_t currRem = ask(1, false);
		if(currRem != rem - removed) {
			for(int32_t i = prevInd; i < ind; i++) {
				if(ask(primes[i], false) != 0) {
					ans *= primes[i];
					break;
				}
			}

			std::cout << "C " << ans << '\n' << std::flush;
			return 0;
		}

		rem = currRem;
	}

	std::cout << "C " << ans << '\n' << std::flush;
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstring>
#include <cassert>

const int32_t BUCKET = 316;

bool is_prime(int32_t x) {
	if(x == 2) {
		return true;
	}
	else if(x % 2 == 0) {
		return false;
	}

	for(int32_t i = 3; i * i <= x; i += 2) {
		if(x % i == 0) {
			return false;
		}
	}

	return true;
}

int32_t cntAsked = 0;
int32_t ask(int32_t x, bool remove) {
	std::cout << (remove ? "B " : "A ") << x << '\n' << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t n;
	std::cin >> n;

	std::vector< int32_t > primes;
	for(int32_t i = 2; i <= n; i++) {
		if(is_prime(i)) {
			primes.push_back(i);
		}
	}

	int32_t ans = 1, ind = 0;
	for(; ind < primes.size(); ind++) {
		auto &x = primes[ind];

		if(x * x > n) {
			break;
		}

		int32_t aux = x;
		while(aux * x <= n) {
			aux *= x;
		}

		while(aux > 1) {
			ask(aux, true);

			if(ask(aux, false) != 0) {
				ans *= aux;
				break;
			}

			aux /= x;
		}

		if(aux != 1) {
			ask(x, true);
		}
	}

	if(ans == 1) {
		int32_t rem = ask(1, false);
		while(ind < primes.size()) {
			int32_t prevInd = ind, removed = 0;
			for(int32_t i = 0; i < BUCKET; i++) {
				if(ind == primes.size()) {
					break;
				}

				removed++;
				assert(ask(primes[ind], true) <= 2);
				ind++;
			}

			int32_t currRem = ask(1, false);
			if(currRem != rem - removed) {
				for(int32_t i = prevInd; i < ind; i++) {
					if(ask(primes[i], false) != 0) {
						ans *= primes[i];
						break;
					}
				}

				std::cout << "C " << ans << '\n' << std::flush;
				return 0;
			}

			rem = currRem;
		}

		std::cout << "C " << ans << '\n' << std::flush;
	}
	else {
		while(ind < primes.size()) {
			if(ask(primes[ind], true) == 2) {
				ans *= primes[ind];
				break;
			}

			ind++;
		}

		std::cout << "C " << ans << '\n' << std::flush;
	}
}


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

// Hate My Life //

#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define ppb pop_back()
#define ppf pop_front()
#define all(vec) vec.begin(), vec.end()
#define fol(i,a,b) for(int i=a;i<b;i++)
#define loop(i,a,b) for(int i=a;i>=b;i--)
#define forr(x,arr) for(auto& x:arr)
#define mod 1000000007
#define INF 0x3f3f3f3f3f3f3f3f
#define EPS 1e-7
#define sz(x) ((lli)(x).size())

using   lli     =   long long;
using   lld     =   long double;
using   ulli    =   unsigned long long int;
using   pll     =   pair<lli, lli>;
using   ttt     =   pair<lli, pll>;
using   vttt    =   vector<ttt>;
using   vll     =   vector<pll>;
using   vl      =   vector<lli>;
using   vi      =   vector<int>;
using   vvi     =   vector<vector<int>>;
using   cd      =   complex<lld>;
const double PI = acos(-1);

#ifndef tejasp
#define trace(...) {}
#define cotra(...) {}
#define end_routine() {}
#define localsys 0
#endif

#define SMAX 100010
vi prime;
int lp[SMAX];

void sieve (int lim) {
    lp[1]=1; //cross-check again
    fol(i,2,lim+1) {
        if (lp[i]==0) {
            prime.pb(i);
            lp[i]=i;
        }
        forr(x,prime) {
            if (x*i > lim) break;
            lp[x*i] = x;
            if (i%x == 0) break;
        }
    }
}

int query (char ch, int val) {
    cout << ch << " " << val << endl;
    int ans;
    cin >> ans;
    return ans;
}

int white_horseman()
{
    lli n, m, k, q, u, v, temp=0, ans=1;
    cin >> n;

    sieve(n);
    trace(lp[99991])
    fol(i,0,n+1) lp[i] = 1;

    vi curslide, factors;
    bool fl = 0;
    int expected = n;

    forr(x,prime) {
        if (x > n) break;

        int cnt = 0;
        for(int j = x; j <=n; j+=x) cnt += lp[j];
        trace(cnt)

        if (query('B',x) != cnt) factors.pb(x);

        curslide.pb(x);
        for(int j = x; j <=n; j+=x)
            if (lp[j]) lp[j] = 0, expected--;

        if (fl || sz(curslide) < 100) continue;

        trace(expected)
        if (query('A',1) != expected) {
            forr(x,curslide) if (query('A',x)) {
                factors.pb(x);
                break;
            }
            fl = 1;
        }
        cerr << x;
        curslide.clear();
    }

    if (!fl) {
        forr(x,curslide) if (query('A',x)) {
            factors.pb(x);
            break;
        }
    }

    sort(all(factors));
    factors.erase(unique(all(factors)),factors.end());

    forr(x,factors) {
        lli val = 1LL * x * x;
        ans *= x;
        while (query('A',val)) {
            ans *= x;
            val *= x;
        }
    }

    cout << 'C' << " " << ans << endl;

    return 0;
}

signed main()
{
    if(!localsys) { ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); }
    cout << fixed << setprecision(10);
    int t=1;
    //cin>>t;
    fol(i,0,t) {
        //cout<<"Case #"<<i+1<<": ";
        white_horseman();
    }
    end_routine(); if(localsys) system("pause");
}


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

// Hate My Life //

#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define ppb pop_back()
#define ppf pop_front()
#define all(vec) vec.begin(), vec.end()
#define fol(i,a,b) for(int i=a;i<b;i++)
#define loop(i,a,b) for(int i=a;i>=b;i--)
#define forr(x,arr) for(auto& x:arr)
#define mod 1000000007
#define INF 0x3f3f3f3f3f3f3f3f
#define EPS 1e-7
#define sz(x) ((lli)(x).size())

using   lli     =   long long;
using   lld     =   long double;
using   ulli    =   unsigned long long int;
using   pll     =   pair<lli, lli>;
using   ttt     =   pair<lli, pll>;
using   vttt    =   vector<ttt>;
using   vll     =   vector<pll>;
using   vl      =   vector<lli>;
using   vi      =   vector<int>;
using   vvi     =   vector<vector<int>>;
using   cd      =   complex<lld>;
const double PI = acos(-1);

#ifndef tejasp
#define trace(...) {}
#define cotra(...) {}
#define end_routine() {}
#define localsys 0
#endif

#define SMAX 100010
vi prime;
int lp[SMAX];

void sieve (int lim) {
    lp[1]=1; //cross-check again
    fol(i,2,lim+1) {
        if (lp[i]==0) {
            prime.pb(i);
            lp[i]=i;
        }
        forr(x,prime) {
            if (x*i > lim) break;
            lp[x*i] = x;
            if (i%x == 0) break;
        }
    }
}

int query (char ch, int val) {
    cout << ch << " " << val << endl;
    int ans;
    cin >> ans;
    return ans;
}

int white_horseman()
{
    lli n, m, k, q, u, v, temp=0, ans=0;
    cin >> n;

    sieve(n);
    fol(i,0,n+1) lp[i] = 1;

    vi curslide, factors;
    bool fl = 0;

    forr(x,prime) {
        if (x > n) break;
        int cnt = 0;
        for(int j = x; j <=n; j+=x) cnt += lp[j];
        trace(cnt)
        if (query('B',x) != cnt) factors.pb(x);
        curslide.pb(x);
        if (fl) {}
        else if (sz(curslide) >= 100 || x == prime.back()) {
            forr(x,curslide) if (query('A',x)) {
                factors.pb(x);
                fl = 1;
                break;
            }
            curslide.clear();
        }
        for(int j = x; j <=n; j+=x) lp[j] = 0;
    }
    cotra(factors)
    sort(all(factors));
    factors.erase(unique(all(factors)),factors.end());
    ans = 1;
    forr(x,factors) {
        lli val = 1LL * x * x;
        ans *= x;
        while (query('A',val)) {
            ans *= x;
            val *= x;
        }
    }
    cout << 'C' << " " << ans << endl;
    return 0;
}

signed main()
{
    if(!localsys) { ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); }
    cout << fixed << setprecision(10);
    int t=1;
    //cin>>t;
    fol(i,0,t) {
        //cout<<"Case #"<<i+1<<": ";
        white_horseman();
    }
    end_routine(); if(localsys) system("pause");
}


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

// Hate My Life //

#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define ppb pop_back()
#define ppf pop_front()
#define all(vec) vec.begin(), vec.end()
#define fol(i,a,b) for(int i=a;i<b;i++)
#define loop(i,a,b) for(int i=a;i>=b;i--)
#define forr(x,arr) for(auto& x:arr)
#define mod 1000000007
#define INF 0x3f3f3f3f3f3f3f3f
#define EPS 1e-7
#define sz(x) ((lli)(x).size())

using   lli     =   long long;
using   lld     =   long double;
using   ulli    =   unsigned long long int;
using   pll     =   pair<lli, lli>;
using   ttt     =   pair<lli, pll>;
using   vttt    =   vector<ttt>;
using   vll     =   vector<pll>;
using   vl      =   vector<lli>;
using   vi      =   vector<int>;
using   vvi     =   vector<vector<int>>;
using   cd      =   complex<lld>;
const double PI = acos(-1);

#ifndef tejasp
#define trace(...) {}
#define cotra(...) {}
#define end_routine() {}
#define localsys 0
#endif

#define SMAX 100010
vi prime;
int lp[SMAX];

void sieve (int lim) {
    lp[1]=1; //cross-check again
    fol(i,2,lim+1) {
        if (lp[i]==0) {
            prime.pb(i);
            lp[i]=i;
        }
        forr(x,prime) {
            if (x*i > lim) break;
            lp[x*i] = x;
            if (i%x == 0) break;
        }
    }
}

int query (char ch, int val) {
    cout << ch << " " << val << endl;
    int ans;
    cin >> ans;
    return ans;
}

int white_horseman()
{
    lli n, m, k, q, u, v, temp=0, ans=1;
    cin >> n;

    sieve(n);
    trace(lp[99991])
    fol(i,0,n+1) lp[i] = 1;

    vi curslide, factors;
    bool fl = 0;
    int expected = n;

    forr(x,prime) {
        if (x > n) break;

        int cnt = 0;
        for(int j = x; j <=n; j+=x) cnt += lp[j];
        trace(cnt)

        if (query('B',x) != cnt) factors.pb(x);

        curslide.pb(x);
        for(int j = x; j <=n; j+=x)
            if (lp[j]) lp[j] = 0, expected--;

        if (fl || sz(curslide) < 100) continue;

        trace(expected)
        if (query('A',1) != expected) {
            forr(y,curslide) if (query('A',y)) {
                factors.pb(y);
                break;
            }
            fl = 1;
        }
        cerr << x;
        curslide.clear();
    }

    if (!fl) {
        forr(x,curslide) if (query('A',x)) {
            factors.pb(x);
            break;
        }
    }

    sort(all(factors));
    factors.erase(unique(all(factors)),factors.end());

    forr(x,factors) {
        lli val = 1LL * x * x;
        ans *= x;
        while (query('A',val)) {
            ans *= x;
            val *= x;
        }
    }

    cout << 'C' << " " << ans << endl;

    return 0;
}

signed main()
{
    if(!localsys) { ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); }
    cout << fixed << setprecision(10);
    int t=1;
    //cin>>t;
    fol(i,0,t) {
        //cout<<"Case #"<<i+1<<": ";
        white_horseman();
    }
    end_routine(); if(localsys) system("pause");
}


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

// Hate My Life //

#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define ppb pop_back()
#define ppf pop_front()
#define all(vec) vec.begin(), vec.end()
#define fol(i,a,b) for(int i=a;i<b;i++)
#define loop(i,a,b) for(int i=a;i>=b;i--)
#define forr(x,arr) for(auto& x:arr)
#define mod 1000000007
#define INF 0x3f3f3f3f3f3f3f3f
#define EPS 1e-7
#define sz(x) ((lli)(x).size())

using   lli     =   long long;
using   lld     =   long double;
using   ulli    =   unsigned long long int;
using   pll     =   pair<lli, lli>;
using   ttt     =   pair<lli, pll>;
using   vttt    =   vector<ttt>;
using   vll     =   vector<pll>;
using   vl      =   vector<lli>;
using   vi      =   vector<int>;
using   vvi     =   vector<vector<int>>;
using   cd      =   complex<lld>;
const double PI = acos(-1);

#ifndef tejasp
#define trace(...) {}
#define cotra(...) {}
#define end_routine() {}
#define localsys 0
#endif

#define SMAX 100010
vi prime;
int lp[SMAX];

void sieve (int lim) {
    lp[1]=1; //cross-check again
    fol(i,2,lim+1) {
        if (lp[i]==0) {
            prime.pb(i);
            lp[i]=i;
        }
        forr(x,prime) {
            if (x*i > lim) break;
            lp[x*i] = x;
            if (i%x == 0) break;
        }
    }
}

int query (char ch, int val) {
    cout << ch << " " << val << endl;
    static int ans;
    cin >> ans;
    return ans;
}

int white_horseman()
{
    lli n, m, k, q, u, v, temp=0, ans=1;
    cin >> n;

    sieve(n);
    fol(i,0,n+1) lp[i] = 1;

    vi curslide, factors;
    bool fl = 0;
    int expected = n, lim = sqrt(sz(prime));

    forr(x,prime) {
        if (x > n) break;

        int cnt = 0;
        for(int j = x; j <=n; j+=x) cnt += lp[j];
        trace(cnt)

        if (query('B',x) != cnt) factors.pb(x);

        for(int j = x; j <=n; j+=x)
            if (lp[j]) lp[j] = 0, expected--;

        if (fl) continue;

        curslide.pb(x);
        if (sz(curslide) < 100) continue;

        trace(expected)
        if (query('A',1) != expected) {
            forr(y,curslide) if (query('A',y)) {
                factors.pb(y);
                break;
            }
            fl = 1;
        }

        curslide.clear();
    }

    if (!fl) {
        forr(x,curslide) if (query('A',x)) {
            factors.pb(x);
            break;
        }
    }

    sort(all(factors));
    factors.erase(unique(all(factors)),factors.end());

    forr(x,factors) {
        lli val = 1LL * x * x;
        ans *= x;
        while (val <= n && query('A',val)) {
            ans *= x;
            val *= x;
        }
    }

    cout << 'C' << " " << ans << endl;

    return 0;
}

signed main()
{
    if(!localsys) { ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); }
    cout << fixed << setprecision(10);
    int t=1;
    //cin>>t;
    fol(i,0,t) {
        //cout<<"Case #"<<i+1<<": ";
        white_horseman();
    }
    end_routine(); if(localsys) system("pause");
}


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

// Hate My Life //

#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define ppb pop_back()
#define ppf pop_front()
#define all(vec) vec.begin(), vec.end()
#define fol(i,a,b) for(int i=a;i<b;i++)
#define loop(i,a,b) for(int i=a;i>=b;i--)
#define forr(x,arr) for(auto& x:arr)
#define mod 1000000007
#define INF 0x3f3f3f3f3f3f3f3f
#define EPS 1e-7
#define sz(x) ((lli)(x).size())

using   lli     =   long long;
using   lld     =   long double;
using   ulli    =   unsigned long long int;
using   pll     =   pair<lli, lli>;
using   ttt     =   pair<lli, pll>;
using   vttt    =   vector<ttt>;
using   vll     =   vector<pll>;
using   vl      =   vector<lli>;
using   vi      =   vector<int>;
using   vvi     =   vector<vector<int>>;
using   cd      =   complex<lld>;
const double PI = acos(-1);

#ifndef tejasp
#define trace(...) {}
#define cotra(...) {}
#define end_routine() {}
#define localsys 0
#endif

#define SMAX 100010
vi prime;
int lp[SMAX];

void sieve (int lim) {
    lp[1]=1; //cross-check again
    fol(i,2,lim+1) {
        if (lp[i]==0) {
            prime.pb(i);
            lp[i]=i;
        }
        forr(x,prime) {
            if (x*i > lim) break;
            lp[x*i] = x;
            if (i%x == 0) break;
        }
    }
}

int query (char ch, int val) {
    cout << ch << " " << val << endl;
    int ans;
    cin >> ans;
    return ans;
}

int white_horseman()
{
    lli n, m, k, q, u, v, temp=0, ans=0;
    cin >> n;

    sieve(n);
    fol(i,0,n+1) lp[i] = 1;

    vi curslide, factors;
    bool fl = 0;
    int expected = n;

    forr(x,prime) {
        if (x > n) break;

        int cnt = 0;
        for(int j = x; j <=n; j+=x) cnt += lp[j];
        trace(cnt)

        if (query('B',x) != cnt) factors.pb(x);

        curslide.pb(x);
        for(int j = x; j <=n; j+=x)
            if (lp[j]) lp[j] = 0, expected--;
        trace(expected)

        if (fl || (sz(curslide) < 100 && x != prime.back())) {}
        else if (query('A',1) != expected) {
            forr(x,curslide) if (query('A',x)) {
                factors.pb(x);
                break;
            }
            curslide.clear();
            fl = 1;
        }
    }
    cotra(factors)
    sort(all(factors));
    factors.erase(unique(all(factors)),factors.end());
    ans = 1;
    forr(x,factors) {
        lli val = 1LL * x * x;
        ans *= x;
        while (query('A',val)) {
            ans *= x;
            val *= x;
        }
    }
    cout << 'C' << " " << ans << endl;
    return 0;
}

signed main()
{
    if(!localsys) { ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); }
    cout << fixed << setprecision(10);
    int t=1;
    //cin>>t;
    fol(i,0,t) {
        //cout<<"Case #"<<i+1<<": ";
        white_horseman();
    }
    end_routine(); if(localsys) system("pause");
}


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

// Hate My Life //

#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define ppb pop_back()
#define ppf pop_front()
#define all(vec) vec.begin(), vec.end()
#define fol(i,a,b) for(int i=a;i<b;i++)
#define loop(i,a,b) for(int i=a;i>=b;i--)
#define forr(x,arr) for(auto& x:arr)
#define mod 1000000007
#define INF 0x3f3f3f3f3f3f3f3f
#define EPS 1e-7
#define sz(x) ((lli)(x).size())

using   lli     =   long long;
using   lld     =   long double;
using   ulli    =   unsigned long long int;
using   pll     =   pair<lli, lli>;
using   ttt     =   pair<lli, pll>;
using   vttt    =   vector<ttt>;
using   vll     =   vector<pll>;
using   vl      =   vector<lli>;
using   vi      =   vector<int>;
using   vvi     =   vector<vector<int>>;
using   cd      =   complex<lld>;
const double PI = acos(-1);

#ifndef tejasp
#define trace(...) {}
#define cotra(...) {}
#define end_routine() {}
#define localsys 0
#endif

#define SMAX 100010
vi prime;
int lp[SMAX];

void sieve (int lim) {
    lp[1]=1; //cross-check again
    fol(i,2,lim+1) {
        if (lp[i]==0) {
            prime.pb(i);
            lp[i]=i;
        }
        forr(x,prime) {
            if (x*i > lim) break;
            lp[x*i] = x;
            if (i%x == 0) break;
        }
    }
}

int query (char ch, int val) {
    cout << ch << " " << val << endl;
    int ans;
    cin >> ans;
    return ans;
}

int white_horseman()
{
    lli n, m, k, q, u, v, temp=0, ans=1;
    cin >> n;

    sieve(n);
    trace(lp[99991])
    fol(i,0,n+1) lp[i] = 1;

    vi curslide, factors;
    bool fl = 0;
    int expected = n;

    forr(x,prime) {
        if (x > n) break;

        int cnt = 0;
        for(int j = x; j <=n; j+=x) cnt += lp[j];
        trace(cnt)

        if (query('B',x) != cnt) factors.pb(x);

        curslide.pb(x);
        for(int j = x; j <=n; j+=x)
            if (lp[j]) lp[j] = 0, expected--;

        if (fl || sz(curslide) < 100) continue;

        trace(expected)
        if (query('A',1) != expected) {
            forr(y,curslide) if (query('A',y)) {
                factors.pb(y);
                break;
            }
            fl = 1;
        }
        cerr << x;
        curslide.clear();
    }

    if (!fl) {
        forr(x,curslide) if (query('A',x)) {
            factors.pb(x);
            break;
        }
    }

    sort(all(factors));
    factors.erase(unique(all(factors)),factors.end());

    forr(x,factors) {
        lli val = 1LL * x * x;
        ans *= x;
        while (val <= n && query('A',val)) {
            ans *= x;
            val *= x;
        }
    }

    cout << 'C' << " " << ans << endl;

    return 0;
}

signed main()
{
    if(!localsys) { ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); }
    cout << fixed << setprecision(10);
    int t=1;
    //cin>>t;
    fol(i,0,t) {
        //cout<<"Case #"<<i+1<<": ";
        white_horseman();
    }
    end_routine(); if(localsys) system("pause");
}