#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() { int n = read_int(); read_linebreak(); assert(1 <= n && n <= 100000); int64_t l[n], r[n]; for (int i = 0; i < n; i++) { if (i) assert(getchar() == ' '); l[i] = read_int(); } read_linebreak(); for (int i = 0; i < n; i++) { if (i) assert(getchar() == ' '); r[i] = read_int(); } read_linebreak(); for (int i = 0; i < n; i++) assert(0 <= l[i] && l[i] < r[i] && r[i] <= 1000000000000000000); for (int i = 0; i < n; i++) { if (i) assert(getchar() == ' '); int d = read_int(); assert(0 <= d && d < 10); } read_linebreak(); assert(getchar() == EOF); return 0; }