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.
import java.util.*;
import java.io.*;
import java.math.BigInteger;
import java.text.*;
public class Main {
    static int mod = 1000_000_007;
    static long lim = (long)1e9 + 6;
    static long mod1 = 998244353;
    static boolean fileIO = false;
    static FastScanner f;
    static int inf = 2000_000_000;
    static PrintWriter pw = new PrintWriter(System.out);
    static Scanner S = new Scanner(System.in);
    static long x0; static long y0;
    static long iinf = (long)(1e18);
    static double eps = (double)1e-4;
    static int ask1(int x) {
        pni("A " + x);
        return f.ni();
    }

    static int ask2(int x) {
        pni("B " + x);
        return f.ni();
    }
    public static void solve()throws IOException {
        int n = f.ni();

        ArrayList<Integer> primes = new ArrayList<>();
        boolean sieve[] = new boolean[n + 1];
        Arrays.fill(sieve , true);
        
        for (int i = 2; i <= n; ++i) {
            if (sieve[i]) {
                for (int j = 2 * i; j <= n; j += i) {
                    sieve[j] = false;
                }
                primes.add(i);
            }
        }

        int rem = n;
        ArrayList<Integer> pf = new ArrayList<>();
        for (int i = 0; i < primes.size(); i += 100) {
            for (int j = i; j < Math.min(i + 100 , primes.size()); ++j) {
                rem -= ask2(primes.get(j));
            }
            int curr_rem = ask1(1);
            if (rem != curr_rem) {
                rem = curr_rem;
                for (int j = i; j < Math.min(i + 100 , primes.size()); ++j) {
                    if (ask1(primes.get(j)) >= 1) pf.add(primes.get(j)); 
                }
            }
        }
        int ans = 1;
        for (Integer p : pf) ans *= p;

        for (Integer p : pf) {
            int curr = p;
            while ((1l * ans * p) <= (1l * n) && ask1(curr * p) >= 1) {
                ans *= p;
                curr *= p;
            }
        }
        pni("C " + ans);
    }
    public static void main(String[] args)throws IOException {
        init();
        int t = 1;
        int tt = 1;
        //fw = new FileWriter("!out.txt");
        while(t --> 0) {
            //fw.write("Case #" + (tt++) + ": ");
            //fw.write("\n");
            solve();
        }
        pw.flush(); 
        pw.close();
        //fw.close();  
    }
        
/******************************END OF MAIN PROGRAM*******************************************/
    public static void init()throws IOException{f=new FastScanner(System.in);}
    public static class FastScanner {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastScanner.SpaceCharFilter filter;
 
        public FastScanner(InputStream stream) {
            this.stream = stream;
        }
 
        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
 
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
 
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
 
        public int ni() {
            int c = read();
 
            while (isSpaceChar(c))
                c = read();
 
            int sgn = 1;
 
            if (c == '-') {
                sgn = -1;
                c = read();
            }
 
            int res = 0;
            do {
                if (c < '0' || c > '9') throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
 
            return res * sgn;
        }
 
        public long nl() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
 
            do {
                if (c < '0' || c > '9') throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));
            return res.toString();
        }
 
        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
    public static void pn(Object o){pw.println(o);}
    public static void pi(Object o){pw.print(o);pw.flush();}
    public static void p(Object o){pw.print(o);}
    public static void pni(Object o){pw.println(o);pw.flush();}
    static int gcd(int a,int b){if(b==0)return a;else{return gcd(b,a%b);}}
    static long gcd(long a,long b){if(b==0l)return a;else{return gcd(b,a%b);}}
    static long lcm(long a,long b){return (a*b/gcd(a,b));}
    static long exgcd(long a,long b){if(b==0){x0=1;y0=0;return a;}long temp=exgcd(b,a%b);long t=x0;x0=y0;y0=t-a/b*y0;return temp;}
    static long pow(long a,long b){long res=1;while(b>0){if((b&1)==1)res=res*a;b>>=1;a=a*a;}return res;}
    static long mpow(long a,long b, long m){long res=1;while(b>0){if((b&1)==1)res=((res%m)*(a%m))%m;b>>=1;a=((a%m)*(a%m))%m;}return res;}
    static long mul(long a , long b){return ((a%mod)*(b%mod)%mod);}
    static long adp(long a , long b){return ((a%mod)+(b%mod)%mod);}
    static boolean isPrime(long n){if(n<=1)return false;if(n<=3)return true;if(n%2==0||n%3==0)return false;for(long i=5;i*i<=n;i=i+6)if(n%i==0||n%(i+2)==0)return false;return true;}
    static boolean isPrime(int n){if(n<=1)return false;if(n<=3)return true;if(n%2==0||n%3==0)return false;for(int i=5;i*i<=n;i=i+6)if(n%i==0||n%(i+2)==0)return false;return true;}
    static HashSet<Long> factors(long n){HashSet<Long> hs=new HashSet<Long>();for(long i=1;i<=(long)Math.sqrt(n);i++){if(n%i==0){hs.add(i);hs.add(n/i);}}return hs;}
    static HashSet<Integer> factors(int n){HashSet<Integer> hs=new HashSet<Integer>();for(int i=1;i<=(int)Math.sqrt(n);i++){if(n%i==0){hs.add(i);hs.add(n/i);}}return hs;}
    static HashSet<Long> pf(long n){HashSet<Long> ff=factors(n);HashSet<Long> ans=new HashSet<Long>();for(Long i:ff)if(isPrime(i))ans.add(i);return ans;}
    static HashSet<Integer> pf(int n){HashSet<Integer> ff=factors(n);HashSet<Integer> ans=new HashSet<Integer>();for(Integer i:ff)if(isPrime(i))ans.add(i);return ans;}
    static int[] inpint(int n){int arr[]=new int[n+1];for(int i=1;i<=n;++i){arr[i]=f.ni();}return arr;}
    static long[] inplong(int n){long arr[] = new long[n+1];for(int i=1;i<=n;++i){arr[i]=f.nl();}return arr;}
    static boolean ise(int x){return ((x&1)==0);}static boolean ise(long x){return ((x&1)==0);}
    static int gnv(char c){return Character.getNumericValue(c);}
    static int log(long x){return x==1?0:(1+log(x/2));} static int log(int x){return x==1?0:(1+log(x/2));}
    static void sort(int[] a){ArrayList<Integer> l=new ArrayList<>();for(int i:a)l.add(i);Collections.sort(l);for(int i=0;i<a.length;++i)a[i]=l.get(i);}
    static void sort(long[] a){ArrayList<Long> l=new ArrayList<>();for(long i:a)l.add(i);Collections.sort(l);for(int i=0;i<a.length;++i)a[i]=l.get(i);}
    static void sort(ArrayList<Integer> a){Collections.sort(a);}
}