// 1 表格的行列值 // 2 要交换的两个单元格的行列值 // 3 输入要插入的行的数值 // 4 输入要插入的列的数值 // 5 输入要查询的单元格的坐标 while(str = readline()) { let [m, n] = str.split(' ').map(i => Number(i)) let [x1, y1, x2, y2] = readline().split(' ').map(i => Number(i)) let xl = Number(readline()) let yl = Number(readline()) let [x, y] = readline().split(' ').map(i => Number(i)) print(m>9 || n>9 || m<=0 || n<=0? -1:0) print(x1>m-1 || x2>m-1 || y1>n-1 || y2>n-1 || x1<0 || x2<0 || y1<0 || y2<0? -1:0) print(m+1>9 || xl>m-1 || xl<0? -1:0) print(n+1>9 || yl>n-1 || yl<0? -1:0) print(x>m-1 || y>n-1 || x<0 || y<0? -1:0) }