import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop;

immutable long MOD = 10^^6 + 3;

long powmod(long a, long x, long m) {
    long ret = 1;
    while (x) {
        if (x % 2) ret = ret * a % m;
        a = a * a % m;
        x /= 2;
    }
    return ret;
}

int gaussianElimination(ref long[][] org_mat, ref long[] ret) {
    int N = org_mat.length.to!int;
    
    auto mat = new long[][](N, N+1);
    foreach (i; 0..N)
        foreach (j; 0..N+1)
            mat[i][j] = org_mat[i][j];

    foreach (i; 0..N) {
        long maxval = 0;
        int maxrow = -1;
        foreach (j; i..N)
            if (abs(mat[j][i]) > maxval)
                maxval = abs(mat[j][i]), maxrow = j;
        if (maxval == 0)
            return -1;
        swap(mat[i], mat[maxrow]);

        foreach (j; i+1..N+1)
            mat[i][j] = mat[i][j] * powmod(mat[i][i], MOD-2, MOD) % MOD;
        mat[i][i] = 1;
         
        foreach (j; 0..N) {
            if (j == i) continue;
            long mul = mat[j][i];
            foreach (k; i..N+1) {
                (mat[j][k] -= mul * mat[i][k] % MOD) %= MOD;
                mat[j][k] = (mat[j][k] + MOD) % MOD;
            }
        }
    }

    foreach (i; 0..N)
        ret[i] = mat[i][N];

    return 0;
}

long[] B;

long ask(long x) {
    writeln("? ", x);
    debug {
        long res = 0;
        foreach (i; 0..11) (res += B[i] * powmod(x, i, MOD) % MOD) %= MOD;
        return res;
    }
    stdout.flush;
    return readln.chomp.to!long;
}

void ans(long x) {
    writeln("! ", x);
    return;
}

void main() {
    debug {
        B = new long[](11);
        B[0] = 1000002;
        B[2] = 1;
    }

    int N = 11;
    auto mat = new long[][](N, N+1);
    
    foreach (i; 0..N) {
        foreach (j; 0..N) mat[i][j] = powmod(i, j, MOD);
        mat[i][N] = ask(i);
    }
                
    auto A = new long[](N);
    gaussianElimination(mat, A);

    foreach (i; 0..MOD) {
        long res = 0;
        foreach (j; 0..N) (res += A[j] * powmod(i, j, MOD) % MOD) %= MOD;
        if (res == 0) {
            ans(i);
            return;
        }
    }

    ans(-1);
}
