#include <bits/stdc++.h>
using namespace std;
void print(int x) {
  printf("! %d\n", x);
  exit(0);
}
int get(int x) {
  printf("? %d\n", x);
  fflush(stdout);
  int ans;
  scanf("%d", &ans);
  if (ans == 0) print(x);
  return ans;
}
long long mod = 1e6 + 3;
long long a[12][13];
long long ans[12];
long long qpow(long long x, long long y) {
  if (y == 0) return 1;
  if (y == 1) return x;
  long long tmp = qpow(x, y / 2);
  if (y % 2)
    return tmp * tmp % mod * x % mod;
  else
    return tmp * tmp % mod;
}
long long inv(long long x) { return qpow(x, mod - 2); }
long long divide(long long x, long long y) { return x * inv(y) % mod; }
int main() {
  for (int i = 0; i <= 10; i++) {
    for (int j = 0; j <= 10; j++) a[i][j] = qpow(i, j);
    a[i][11] = get(i);
  }
  for (int i = 0; i < 10; i++) {
    int now = i;
    for (int j = 0; j <= 10; j++)
      if (abs(a[j][i]) && a[now][i] == 0) {
        now = j;
        break;
      }
    if (a[now][i] == 0) exit(-1);
    if (now != i) swap(a[i], a[now]);
    for (int j = i + 1; j <= 11; j++) a[i][j] = divide(a[i][j], a[i][i]);
    a[i][i] = 1;
    for (int j = i + 1; j <= 10; j++) {
      for (int k = i + 1; k <= 11; k++)
        a[j][k] = (a[j][k] - a[j][i] * a[i][k] % mod + mod) % mod;
      a[j][i] = 0;
    }
  }
  for (int i = 10; i >= 0; i--) {
    for (int j = 10; j >= i + 1; j--)
      a[i][11] = (a[i][11] - ans[j] * a[i][j] % mod + mod) % mod;
    ans[i] = divide(a[i][11], a[i][i]);
  }
  for (int i = 0; i < mod; i++) {
    long long now = 0;
    for (int j = 0; j <= 10; j++) now = (now + ans[j] * qpow(i, j)) % mod;
    if (now == 0) print(i);
  }
  print(-1);
  return 0;
}
