require'zlib';m=Zlib.inflate(DATA.read.unpack('m')[0]).bytes;w=101;h=89;gets;$<.map{|l|y,x=l.split.map &:to_i;q=y*w+x;p m[q/2]/(16-q%2*15)%16*96} __END__ eNrtlrfy1DAYBx0YaqPjASQRWjK0ZEoy7v+xJNp6fU5z3kHC/GY+d6StLu+e9Dmkv523l8/TJk68 a+6lDcyP2hh992FDUxMzgznt1Lt4gDRDEwSdVjWhMKZNNKEhzdJkSzuumgxp080u/gqZNj+myZp2 MtBkTFNNMm1+I5qAWTM0ibRZN4m01220ENrRWkXYbhTbITfmuWl9xRJP9xkszdCfpzRdTwuv+pHp 1U1535pzJN1wNf+E73TTYYUuJiTLAfRWpA27/IM32+h/SJZRWKXRxCwVEkbh1DvZFGMtiSqNphgr Cf5DmmhaS+q0ddNPEljSikFnJoSkWDWaGDwhqdKqJiGp01ZNUkLNo6JJSYKr02jSknCnqdNo0pIL +5QyjSYt8S/KDP8g3YwgJdV/3aWvLoKWFBeg8CDdMkgyb1q7JNxfzi/OLAnLWfbYWSUxtM95ZpJk fJ9fmTuzhA23StCMaTJKYLhmlkDo3jmzBI3bKAGbBP4oyX/JiKQxSjySfMo1Sdrn4rZLSbjxQtMq CYRuTBXfvJMSjrkKznNSgkLezyPRCjRKEnoU+nYYibxHh+NmJeEsqJjRlJLmfgKpqSSezRMwNkiY DwFjg8SkYGyQBK2oNd4dJGLzxH5mCfNhYfKX9hKbAt726SvzYdW8SM/SX8+n7/Zj+0Q=