Problem: 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.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const int mod = 1000000007;
mt19937 rng((int)std::chrono::steady_clock::now().time_since_epoch().count());
class segment_tree {
 public:
  long long rmaxq[4 * 100000], rminq[4 * 100000], rsumq[4 * 100000];
  void init() {
    for (int i = 0; i < 4 * 100000; i++) {
      rmaxq[i] = 0;
      rminq[i] = 0;
      rsumq[i] = 0;
    }
  }
  void upd_rminq(int lb, int rb, int tar, int ok, long long val) {
    if (lb == rb) {
      rminq[ok] = val;
      return;
    }
    int mid = (lb + rb) / 2;
    if (tar <= mid) {
      upd_rminq(lb, mid, tar, 2 * ok + 1, val);
    } else {
      upd_rminq(mid + 1, rb, tar, 2 * ok + 2, val);
    }
    rminq[ok] = min(rminq[2 * ok + 1], rminq[2 * ok + 2]);
  }
  long long query_rminq(int lb, int rb, int ok, int lconst, int rconst) {
    if (rconst < lb || lconst > rb) {
      return LLONG_MAX;
    }
    if (lconst <= lb && rb <= rconst) {
      return rminq[ok];
    }
    int mid = (lb + rb) / 2;
    return min(query_rminq(lb, mid, ok * 2 + 1, lconst, rconst),
               query_rminq(mid + 1, rb, ok * 2 + 2, lconst, rconst));
  }
  void updall_rminq(long long arr[], int n) {
    for (int i = 0; i < n; i++) upd_rminq(0, 100000 - 1, i, 0, arr[i]);
  }
  void upd_rmaxq(int lb, int rb, int tar, int ok, long long val) {
    if (lb == rb) {
      rmaxq[ok] = val;
      return;
    }
    int mid = (lb + rb) / 2;
    if (tar <= mid) {
      upd_rmaxq(lb, mid, tar, 2 * ok + 1, val);
    } else {
      upd_rmaxq(mid + 1, rb, tar, 2 * ok + 2, val);
    }
    rmaxq[ok] = max(rmaxq[2 * ok + 1], rmaxq[2 * ok + 2]);
  }
  long long query_rmaxq(int lb, int rb, int ok, int lconst, int rconst) {
    if (rconst < lb || lconst > rb) {
      return LLONG_MIN;
    }
    if (lconst <= lb && rb <= rconst) {
      return rmaxq[ok];
    }
    int mid = (lb + rb) / 2;
    return max(query_rmaxq(lb, mid, ok * 2 + 1, lconst, rconst),
               query_rmaxq(mid + 1, rb, ok * 2 + 2, lconst, rconst));
  }
  void updall_rmaxq(long long arr[], int n) {
    for (int i = 0; i < n; i++) {
      upd_rmaxq(0, 100000 - 1, i, 0, arr[i]);
    }
  }
  void upd_rsumq(int lb, int rb, int tar, int ok, long long val) {
    if (lb == rb) {
      rsumq[ok] = val;
      return;
    }
    int mid = (lb + rb) / 2;
    if (tar <= mid) {
      upd_rsumq(lb, mid, tar, 2 * ok + 1, val);
    } else {
      upd_rsumq(mid + 1, rb, tar, 2 * ok + 2, val);
    }
    rsumq[ok] = rsumq[2 * ok + 1] + rsumq[2 * ok + 2];
  }
  long long query_rsumq(int lb, int rb, int ok, int lconst, int rconst) {
    if (rconst < lb || lconst > rb) {
      return 0;
    }
    if (lconst <= lb && rb <= rconst) {
      return rsumq[ok];
    }
    int mid = (lb + rb) / 2;
    return query_rsumq(lb, mid, ok * 2 + 1, lconst, rconst) +
           query_rsumq(mid + 1, rb, ok * 2 + 2, lconst, rconst);
  }
  void updall_rsumq(long long arr[], int n) {
    for (int i = 0; i < n; i++) upd_rsumq(0, 100000 - 1, i, 0, arr[i]);
  }
} st;
class set_union {
 public:
  int a[100000 + 1];
  void init() {
    for (int i = 0; i <= 100000; i++) a[i] = i;
  }
  int set_of(int u) {
    if (a[u] == u)
      return u;
    else
      return a[u] = set_of(a[u]);
  }
  void union_(int u, int v) { a[set_of(u)] = set_of(v); }
  struct SEGT {
    int index;
    char type;
  };
  SEGT make_SEGT(int a, char b) {
    SEGT esgewqt = {a, b};
    return esgewqt;
  }
  class SEGT_COMP {
   public:
    bool operator()(SEGT a, SEGT b) {
      if (a.index == b.index)
        return a.type < b.type;
      else
        return a.index > b.index;
    }
  };
  vector<pair<int, int> > segment_union(vector<pair<int, int> > V, int T) {
    for (int i = 0; i < V.size(); i++) {
      if (V[i].first > V[i].second) {
        swap(V[i].first, V[i].second);
      }
    }
    priority_queue<SEGT, vector<SEGT>, SEGT_COMP> segt_pq1;
    for (int i = 0; i < V.size(); i++) {
      segt_pq1.push(make_SEGT(V[i].first - T, 'S'));
      segt_pq1.push(make_SEGT(V[i].second, 'E'));
    }
    stack<SEGT> process;
    vector<pair<int, int> > UwU;
    while (segt_pq1.size()) {
      if (segt_pq1.top().type == 'E') {
        process.pop();
        if (process.size() == 0) {
          UwU[int(UwU.size()) - 1].second = segt_pq1.top().index;
        }
      } else {
        process.push(segt_pq1.top());
        if (process.size() == 1) {
          UwU.push_back({segt_pq1.top().index + T, 0});
        }
      }
      segt_pq1.pop();
    }
    return UwU;
  }
} su;
void include() {}
int call(char a, int b) {
  cout << a << " " << b << "\n";
  fflush(stdout);
  if (a == 'C') return 0;
  int x;
  cin >> x;
  return x;
}
void solve() {
  int n;
  cin >> n;
  vector<long long> primes;
  bool b[n + 1];
  for (int i = 2; i <= n; i++) b[i] = true;
  b[1] = false;
  for (int i = 2; i * i <= n; i++) {
    if (b[i]) {
      for (int j = i * i; j <= n; j += i) {
        b[j] = false;
      }
    }
  }
  for (int i = 2; i <= n; i++) {
    if (b[i]) primes.push_back(i);
  }
  int cnt = primes.size();
  bool c[n + 1];
  int cur = n;
  long long ans = 1;
  for (int i = 1; i <= n; i++) c[i] = true;
  for (int i = 0; i < min(65, cnt); i++) {
    for (int j = primes[i]; j <= n; j += primes[i]) {
      if (c[j] == true) {
        c[j] = false;
        cur--;
      }
    }
    int res = call('B', primes[i]);
    res = call('A', 1);
    if (cur != res) {
      long long bas = 1;
      while (true) {
        bas *= primes[i];
        if (bas > n) {
          bas /= primes[i];
          break;
        }
        int res2 = call('A', bas);
        if (res2 == 0) {
          bas /= primes[i];
          break;
        }
      }
      ans *= bas;
    }
  }
  cur = call('A', 1);
  int i = 65;
  while (i < cnt) {
    int mid = (i + cnt) / 2;
    for (int j = i; j <= mid; j++) {
      int res = call('B', primes[j]);
      int chk = 0;
      for (int k = primes[j]; k <= n; k += primes[j]) {
        if (c[k] == true) {
          c[k] = false;
          cur--;
          chk++;
        }
      }
      if (chk == 1 && res == 2 && primes[j] * primes[j] > n) {
        call('C', ans * primes[j]);
        return;
      }
    }
    int res = call('A', 1);
    if (res != cur) {
      for (int j = i; j <= mid; j++) {
        int res2 = call('A', primes[j]);
        if (res2 == 1) {
          ans *= primes[j];
          break;
        }
      }
      i = cnt;
    } else {
      i = mid + 1;
    }
  }
  int finally = call('C', ans);
  return;
}
int main() {
  srand(time(NULL));
  include();
  int t = 1;
  while (t--) {
    solve();
  }
}