/*
Jackson Simoneau
SI@UCF 2026 - Intro to Competitive Programming
Contest 2

Solution to Batmanacci: https://open.kattis.com/problems/batmanacci
*/

#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
    ll n, k;
    cin >> n >> k;
    n--, k--;
    vector<ll> s(91);
    s[0] = s[1] = 1;
    for(int i = 2; i <= 90; i++) {
        s[i] = s[i-2] + s[i-1];
    }

    while(k) {
        if(n > 90 || k < s[n-2]) {
            n -= 2;
        } else {
            k -= s[n-2];
            n--;
        }
    }
    cout << (n % 2 ? "A" : "N") << endl;
}