#include<bits/stdc++.h>
using namespace std;
int n,rt;
void solve(){
	scanf("%d%d",&n,&rt);
	puts("1");
}
int main(){
	freopen("dfs.in","r",stdin);
	freopen("dfs.out","w",stdout);
	int _;scanf("%d",&_);
	while(_--)solve();
	return 0;
}
