#include /* strict input checker */ template Integer read_int() { static_assert(std::numeric_limits::is_specialized); int c = getchar(), sign = 0; Integer res = 0; if (c == '-') sign = 1, c = getchar(); assert('0' <= c && c <= '9'); if (sign) assert(c != '0'); res = c - '0'; while (1) { c = getchar(); if (c < '0' || c > '9') break; assert(res < std::numeric_limits::max() / 10); // avoid overflow assert(res); // no leading-zero res = res * 10 + (c - '0'); } ungetc(c, stdin); return sign ? -res : res; } void read_linebreak() { int c = getchar(); if (c == '\r') c = getchar(); assert(c == '\n'); } int main() { std::string s; while (1) { int c = getchar(); if (c == '?' || (c >= '0' && c <= '9')) s.push_back(c); else { ungetc(c, stdin); break; } } read_linebreak(); assert(1 <= s.size() && s.size() <= 100000); int d = read_int(); read_linebreak(); assert(0 <= d && d <= 9); assert(getchar() == EOF); return 0; }