/* cerberus97 - Hanit Banga */

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;

#define pb push_back
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

const int N = 1e5 + 10, mod = 1e9 + 7;

int add(int a, int b) {
	return (a + b) % mod;
}

int mul(ll a, int b) {
	return (a * b) % mod;
}

int main() {
	fast_cin();
	int n; cin >> n;
	char caa, cab, cba, cbb;
	cin >> caa >> cab >> cba >> cbb;
	if (cab == 'B') {
		cab ^= 'A' ^ 'B';
		cba ^= 'A' ^ 'B';
		tie(caa, cbb) = make_pair(cbb ^ 'A' ^ 'B', caa ^ 'A' ^ 'B');
	}
	if (caa == 'A') {
		cout << 1 << '\n';
	} else {
		if (cba == 'A') {
			int m = n - 2, a = 1, b = 1;
			while (m--) {
				tie(a, b) = make_pair(b, add(a, b));
			}
			cout << a << '\n';
		} else {
			int p2 = 1;
			for (int i = 0; i < n - 3; ++i) {
				p2 = mul(p2, 2);
			}
			cout << p2 << '\n';
		}
	}
}
#include <cmath>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include<cstdio>
#include<functional>
#include <bitset>
#include <iomanip>
#include <cctype>
#include <list>
#include <cassert>
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for(ll i = n; i >= 0; i--)
#define ll long long
#define repi(i,a,b) for(ll i=a;i<b;++i)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

using namespace std;
template <typename T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }
template <typename T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
const ll INF = 1000000000000000000;
const ll MOD = 1e9 + 7;
using vvv = vector<vector<vector<ll>>>;
using vv = vector<vector<ll>>;
using vec = vector<ll>;
using P = pair<ll, ll>;

int main() {
	ll a, b, c; cin >> a >> b >> c;
	if (c == 0) {
		if (a > b) cout << "Takahashi" << endl;
		else cout << "Aoki" << endl;
	}
	else {
		if (b > a) cout << "Aoki" << endl;
		else cout << "Takahashi" << endl;
	}
	system("Pause");
}
