#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

#define mod 1000000007

char p[1000005],q[1000005];

ll pre[1000005]={0},ans=0,pre2[1000005]={0},n;

ll solve(ll le,ll ri,ll pos)
{
	if(pos==0) return 0;
	if(le>=ri) return 0;
	if(le==ri-1) 
	{
		ans+=1;return 0;
	}
	ll pos1,pos2;
	
	if(pos==1)
	{
		pos1=le,pos2=le;
	
		while(pos1<=ri)
		{
			if(p[pos1]=='1'&&q[pos1]=='0')
			{
				while(p[pos2]!='0') pos2++;
				
				ans+=1;
				p[pos2]='1';
				
				pos2++;
			}
			pos1++;
		}
	}
	else
	{
		pos1=ri,pos2=ri;
	
		while(pos1>=le)
		{
			if(p[pos1]=='1'&&q[pos1]=='0')
			{
				while(p[pos2]!='0') pos2--;
				
				ans+=1;
				p[pos2]='1';
				
				pos2--;
			}
			pos1--;
		}
	}
	return 0;
}

int main()
{
	ll t,i,j,now1=0,now2=0,nowleft=0,nowway=0,zz1=0,zz2=0;
	cin>>n;
	
	scanf("%s",&p);
	scanf("%s",&q);
	
	for(i=0;i<n;i++)
	{
		if(p[i]=='0') zz1++;
		if(q[i]=='0') zz2++;
	}
	if(zz1!=zz2)
	{
		printf("-1");
		return 0;
	}
	
	if(p[0]=='0') pre[0]=1;
	if(p[0]=='0'&&q[0]=='1') pre2[0]=1; 
	for(i=1;i<n;i++)
	{
		pre[i]=pre[i-1];
		if(p[i]=='0') pre[i]++;
		
		pre2[i]=pre2[i-1];
		if(p[i]=='0'&&q[i]=='1') pre2[i]++;
	}
	
	for(i=0;i<n;i++)
	{
		if(p[i]=='1') now1++;
		if(q[i]=='1') now2++;
		if(now1==now2)
		{
			solve(nowleft,i,nowway);
			nowleft=i+1;
		}
		if(now1>now2) nowway=1;
		else if(now1<now2) nowway=2;
	}
	
	printf("%lld",ans);
	
	return 0;
}
//ye moh moh ke dhaage,tere ungliyon se ja uljhe

#include<bits/stdc++.h>
using namespace std;
 
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl "\n"
 
typedef pair<ll, ll> pii;

typedef vector<ll> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef long double ld;
 
template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

int main(){
    ll a,b,c;
    cin>>a>>b>>c;

    if(c==1){
        if(b>a) cout<<"Aoki";
        else cout<<"Takahashi";
    }
    else{
        if(a>b) cout<<"Takahashi";
        else cout<<"Aoki";        
    }
}