#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned int ui; const ll mod = 1000000007; const ll INF = (ll)1000000007 * 1000000007; typedef pair P; #define stop char nyaa;cin>>nyaa; #define rep(i,n) for(int i=0;i=0;i--) #define Rep(i,sta,n) for(int i=sta;i=1;i--) #define Rep1(i,sta,n) for(int i=sta;i<=n;i++) typedef long double ld; typedef complex Point; const ld eps = 1e-2; const ld pi = acos(-1.0); int n; int q[1 << 12][12]; int r[1 << 12]; int main() { cin >> n; rep(i, 1 << n) { rep(j, n) { cin >> q[i][j]; } cin >> r[i]; } rep(i, (1 << n)) { if (i == 0) { cout << "A="; } else { cout << "∨"; } cout << "("; rep(j, n) { if (j > 0)cout << "∧"; if (q[i][j]^r[i]==0) { cout << "P_" << j + 1; } else { cout << "¬P_" << j + 1; } } cout << ")"; } cout << endl; //stop return 0; }