This is an interactive problem.

There is an unknown integer x (1≤ x≤ n). You want to find x.

At first, you have a set of integers \{1, 2, …, n\}. You can perform the following operations no more than 10000 times:

  * A a: find how many numbers are multiples of a in the current set. 
  * B a: find how many numbers are multiples of a in this set, and then delete all multiples of a, but x will never be deleted (even if it is a multiple of a). In this operation, a must be greater than 1. 
  * C a: it means that you know that x=a. This operation can be only performed once. 



Remember that in the operation of type B a>1 must hold.

Write a program, that will find the value of x.

Input

The first line contains one integer n (1≤ n≤ 10^5). The remaining parts of the input will be given throughout the interaction process.

Interaction

In each round, your program needs to print a line containing one uppercase letter A, B or C and an integer a (1≤ a≤ n for operations A and C, 2≤ a≤ n for operation B). This line desribes operation you make.

If your operation has type C your program should terminate immediately.

Else your program should read one line containing a single integer, which is the answer to your operation.

After outputting each line, don't forget to flush the output. To do it use:

  * fflush(stdout) in C/C++; 
  * System.out.flush() in Java; 
  * sys.stdout.flush() in Python; 
  * flush(output) in Pascal; 
  * See the documentation for other languages. 



It is guaranteed, that the number x is fixed and won't change during the interaction process.

Hacks:

To make a hack, use such input format:

The only line should contain two integers n, x (1 ≤ x ≤ n ≤ 10^5).

Example

Input


10

2

4

0

Output



B 4

A 2

A 8

C 4

Note

Note that to make the sample more clear, we added extra empty lines. You shouldn't print any extra empty lines during the interaction process.

In the first test n=10 and x=4.

Initially the set is: \{1,2,3,4,5,6,7,8,9,10\}.

In the first operation, you ask how many numbers are multiples of 4 and delete them. The answer is 2 because there are two numbers divisible by 4: \{4,8\}. 8 will be deleted but 4 won't, because the number x will never be deleted. Now the set is \{1,2,3,4,5,6,7,9,10\}.

In the second operation, you ask how many numbers are multiples of 2. The answer is 4 because there are four numbers divisible by 2: \{2,4,6,10\}.

In the third operation, you ask how many numbers are multiples of 8. The answer is 0 because there isn't any number divisible by 8 in the current set.

In the fourth operation, you know that x=4, which is the right answer.
#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
template <class T>
bool tmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool tmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
template <typename A>
istream& operator>>(istream& cin, vector<A>& v) {
  for (long long i = 1; i < v.size(); i++) cin >> v[i];
  return cin;
}
template <typename A>
ostream& operator<<(ostream& cout, vector<A> const& v) {
  cout << "[";
  for (long long i = 0; i < v.size(); i++) {
    if (i) cout << ", ";
    cout << v[i];
  }
  return cout << "]";
}
template <typename A, typename B>
ostream& operator<<(ostream& cout, pair<A, B> const& p) {
  return cout << "(" << p.first << ", " << p.second << ")";
}
template <typename A, typename B>
istream& operator>>(istream& cin, pair<A, B>& p) {
  cin >> p.first;
  return cin >> p.second;
}
template <typename T_container, typename T = typename enable_if<
                                    !is_same<T_container, string>::value,
                                    typename T_container::value_type>::type>
ostream& operator<<(ostream& os, const T_container& v) {
  os << '{';
  string sep;
  for (const T& x : v) os << sep << x, sep = ", ";
  return os << '}';
}
void dbg_out() { cerr << endl; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) {
  cerr << ' ' << H;
  dbg_out(T...);
}
long long logg2(long long n) {
  long long tmp;
  for (long long i = 0; i <= 32; i++) {
    tmp = 1 << i;
    if (tmp == n)
      return i;
    else if (tmp > n)
      return i - 1;
  }
  return 32;
}
mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
const long double pi = 3.14159265358979323846;
const long long mod = 1000000007;
long long n, m, k, q, l, r, x, y, z;
vector<long long> a, b, c;
string s, t;
long long ans = 0;
vector<vector<long long> > graph;
vector<bool> visited;
vector<long long> color;
vector<string> vss;
const long long dx[] = {-1, 0, 1, 0};
const long long dy[] = {0, 1, 0, -1};
long long MAXN = 1e6 + 9;
namespace number_theory {
long long gcd(long long x, long long y) {
  if (x == 0) return y;
  if (y == 0) return x;
  return gcd(y, x % y);
}
bool isprime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i += 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
bool prime[15000105];
void sieve(long long n) {
  for (long long i = 0; i <= n; i++) prime[i] = 1;
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  prime[1] = prime[0] = 0;
}
vector<long long> primelist;
bool __primes_generated__ = 0;
void genprimes(long long n) {
  __primes_generated__ = 1;
  sieve(n + 1);
  for (long long i = 2; i <= n; i++)
    if (prime[i]) primelist.push_back(i);
}
vector<long long> factors(long long n) {
  if (!__primes_generated__) {
    cerr << "Call genprimes you dope" << endl;
    exit(1);
  }
  vector<long long> facs;
  for (long long i = 0;
       primelist[i] * primelist[i] <= n && i < primelist.size(); i++) {
    if (n % primelist[i] == 0) {
      while (n % primelist[i] == 0) {
        n /= primelist[i];
        facs.push_back(primelist[i]);
      }
    }
  }
  if (n > 1) {
    facs.push_back(n);
  }
  sort(facs.begin(), facs.end());
  return facs;
}
vector<long long> getdivs(long long n) {
  vector<long long> divs;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      divs.push_back(i);
      divs.push_back(n / i);
    }
  }
  {
    sort(divs.begin() + 1, divs.end());
    divs.erase(unique(divs.begin() + 1, divs.end()), divs.end());
  };
  return divs;
}
}  // namespace number_theory
using namespace number_theory;
void retrace(long long ind) {
  for (long long i = ind; i >= 0; i--) {
    cout << "A " << primelist[i] << endl;
    cin >> x;
    if (x) {
      cout << "C " << primelist[i] << endl;
      return;
    }
  }
}
void planA() {
  r = 0;
  m = primelist.size();
  for (long long i = 0; i < m; i++) {
    if (primelist[i] <= 317) continue;
    cout << "B " << primelist[i] << endl;
    cin >> x;
    r++, l--;
    if (r >= 98 || i == m - 1) {
      r = 0;
      cout << "A 1" << endl;
      cin >> x;
      if (x != l) {
        retrace(i);
        return;
      }
    }
  }
  cout << "C " << 1 << endl;
}
void planB() {
  ans = 1;
  m = primelist.size();
  for (long long i = 0; i < m; i++) {
    if (primelist[i] > 317) break;
    x = 1;
    long long j = 1;
    while (x > 0) {
      y = pow(primelist[i], j);
      if (y > n) break;
      assert(y > 0);
      cout << "A " << y << endl;
      cin >> x;
      j++;
      if (x) ans *= primelist[i];
    }
  }
  for (long long i = 0; i < m; i++) {
    if (ans * primelist[i] > n) break;
    if (primelist[i] < 317) continue;
    cout << "A " << ans * primelist[i] << endl;
    cin >> x;
    if (x) {
      cout << "C " << ans * primelist[i] << endl;
      return;
    }
  }
  cout << "C " << ans << endl;
}
void solve(long long tc = 0) {
  cin >> n;
  long long primes_lessthan318 = 66;
  genprimes(n);
  l = primelist.size() - primes_lessthan318 + 1;
  for (long long i : primelist) {
    if (i > 317) break;
    cout << "B " << i << endl;
    cin >> x;
  }
  cout << "A " << 1 << endl;
  cin >> x;
  if (x == l)
    planA();
  else
    planB();
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  long long tc = 1;
  for (long long tt = 1; tt <= tc; tt++) {
    a.clear(), b.clear(), c.clear();
    graph.clear(), visited.clear(), color.clear();
    s.clear(), t.clear(), vss.clear();
    n = 0, m = 0, k = 0, q = 0, l = 0, r = 0, x = 0, y = 0, z = 0, ans = 0;
    solve(tt);
  }
  return 0;
}
