import java.math.*; import java.util.*; // https://speakerdeck.com/gyudon/shorfalsearugorizumu?slide=7 class Main{ static boolean end(BigInteger r,BigInteger n){ var gcd=r.gcd(n); if(!gcd.equals(BigInteger.ONE)){ System.out.println("! "+gcd+" "+n.divide(gcd)); return true; } return false; } public static void main(String[] $){ var s=new Scanner(System.in); var n=s.nextBigInteger(); var rnd=new Random(); var mod=n.subtract(BigInteger.TWO); while(true){ var v=new BigInteger(n.bitLength(),rnd).mod(mod).add(BigInteger.TWO); if(end(v,n)) return; System.out.println("? "+v); var r=s.nextBigInteger().divideAndRemainder(BigInteger.TWO); if(r[1].equals(BigInteger.ZERO)){ if(end(r[0].add(BigInteger.ONE),n)) return; if(end(r[0].subtract(BigInteger.ONE),n))//true return; } } } }