#!/usr/bin/perl
#
# Problem: 数当てゲーム
# Solution by: MORI Shingo
# O(1)
# 
use strict;
use warnings;
use utf8;

local $| = 1; # set auto flash

my $ans = 1;
my @visit = (0) x 1010;
for my $i (1..1000) {
  next if $visit[$i];
  print("? $i\n");
  my $divide = <STDIN>;
  chomp($divide);
  if ($divide eq "Y") {
    $ans = $i;
  } else {
    for (my $j = $i; $j <= 1000; $j += $i) { $visit[$j] = 1; }
  }
}
print("! $ans\n");
