#include using namespace std; int n; int q[1<<12][12]; int r[12]; int main(void) { cin >> n; for(int i = 1; i <= (1<> q[i][j]; cin >> r[i]; } bool f0 = false, f1 = false; for(int i = 1; i <= (1<