{"raw_statement":[{"iden":"problem statement","content":"Given are an integer $N$ and arrays $S$, $T$, $U$, and $V$, each of length $N$. Construct an $N×N$ matrix $a$ that satisfy the following conditions:\n\n*   $a_{i,j}$ is an integer.\n*   $0 \\leq a_{i,j} \\lt 2^{64}$.\n*   If $S_{i} = 0$, the bitwise AND of the elements in the $i$\\-th row is $U_{i}$.\n*   If $S_{i} = 1$, the bitwise OR of the elements in the $i$\\-th row is $U_{i}$.\n*   If $T_{i} = 0$, the bitwise AND of the elements in the $i$\\-th column is $V_{i}$.\n*   If $T_{i} = 1$, the bitwise OR of the elements in the $i$\\-th column is $V_{i}$.\n\nHowever, there may be cases where no matrix satisfies the conditions."},{"iden":"constraints","content":"*   All values in input are integers.\n*   $1 \\leq N \\leq 500$\n*   $0 \\leq S_{i} \\leq 1$\n*   $0 \\leq T_{i} \\leq 1$\n*   $0 \\leq U_{i} \\lt 2^{64}$\n*   $0 \\leq V_{i} \\lt 2^{64}$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$S_{1}$ $S_{2}$ $...$  $S_{N}$\n$T_{1}$ $T_{2}$ $...$  $T_{N}$\n$U_{1}$ $U_{2}$ $...$  $U_{N}$\n$V_{1}$ $V_{2}$ $...$  $V_{N}$"},{"iden":"sample input 1","content":"2\n0 1\n1 0\n1 1\n1 0"},{"iden":"sample output 1","content":"1 1\n1 0\n\nIn Sample Input $1$, we need to find a matrix such that:\n\n*   the bitwise AND of the elements in the $1$\\-st row is $1$;\n*   the bitwise OR of the elements in the $2$\\-nd row is $1$;\n*   the bitwise OR of the elements in the $1$\\-st column is $1$;\n*   the bitwise AND of the elements in the $2$\\-nd column is $0$."},{"iden":"sample input 2","content":"2\n1 1\n1 0\n15 15\n15 11"},{"iden":"sample output 2","content":"15 11\n15 11"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}