#include<bits/stdc++.h>
using namespace std;
int fa[400050],ring[400050],xd[400050];
int n,a,b,ans;
int find(int x){return x==fa[x]?x:fa[x]=find(fa[x]);}
inline int read()
{
    int x=0,f=1;
    char c=getchar();
    while(c<'0'||c>'9')
    {
        if(c=='-') f=-f;
        c=getchar();
    }
    while(c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
    return x*f;
}
void merge(int x,int y)
{
	int p=find(x),q=find(y);
	if(p==q)
	{
		ring[p]=1;
		return;
	}
	else
	{
		ring[p]=ring[q]=ring[p]|ring[q];
		fa[p]=q;
		xd[q]+=xd[p];
		xd[p]=0;
	}
	return; 
} 
int vis[400050];
int main()
{
	cin>>n;
	for(int i=1;i<=400000;i++) fa[i]=i,xd[i]=1;
	for(int i=1;i<=n;i++)
	{
		a=read();b=read();
		if(a>b) swap(a,b);
		merge(a,b);
	}
	for(int i=1;i<=400000;i++)
	{
		int p=find(i);
		if(ring[p]&&vis[p]==0) ans+=xd[p],vis[p]=1;
		else if(ring[p]==0&&vis[p]==0) ans+=xd[p]-1,vis[p]=1;
	}
	cout<<ans<<endl;
}
//                            **************************** Prajwal ********************************
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp> 
 
 
using namespace std;
//using namespace __gnu_pbds;
//template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
// ordered_set <int> s;
// s.find_by_order(k); // returns the (k+1)th smallest element
// s.order_of_key(k); //returns the number of elements in s strictly less than k
 
 
// numbers
#define MOD (1000000007)
//const int N=200000;
const long long int INF=1000000000000;
//shortforms
#define fast ios::sync_with_stdio(0); cin.tie(0);cout.tie(0)
#define sz(v) int(v.size())
#define ff first
#define ss second 
#define pb push_back
#define pob() pop_back()
#define pf(a) push_front((a))
#define pof() pop_front()
#define nl '\n'
#define all(v) v.begin(),v.end()
//max and min and sum
#define maxv(a) *max_element(all(a))
#define minv(a) *min_element(all(a))
#define sumv(A,a) accumulate(all(A),a)
//for loops
#define fof(i,a,n) for(ll i=a;i<(n);i++)
#define fob(i,n,a) for(ll i=n;i>=a;i--)
//sorting
#define rev(a) reverse(all(a))
#define as(all,A) sort((A).begin(),(A).end())
#define ds(all,A,x) sort((A).begin(),(A).end(),greater<x>())
//permutations
#define nxtp(a,b) next_permutation(a,b);
//input
#define input(A,n) fof(i,0,n){cin>>A[i];}
#define mk_pair(x,y,a,b) insert(pair<x,y >(a,b))
#define mp(x,y) make_pair(x,y)
//output
#define de(a) cerr<<a<<" ";
#define dispve(A,a,n) fof(i,a,n){cout<<A[i]<<" ";}
#define dismp(m) for(auto x : m){ cout<<x.ff<<" "<<x.ss<<"\n"; }
// shortforms 
typedef long long int ll;
#define int ll
//code begins	
int n,m;


void solve(int c)
{
	cin>>n;
	if(n%2==1){
      cout<<"Odd";
      return;
    }
  	else if(n%4!=0){
      cout<<"Same";
    }
  	else{
      cout<<"Even";
    }
}
 
signed main()
{
	fast;
	int T=1;
	cin >> T;
	//cout<< fixed << setprecision(10);
	int cnt = 1;
	while(T--){
		solve(cnt);
		cnt++;
		cout<<nl;
	}
	return 0;
} 
