#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ll long long int ll const MOD = 1000000007; ll const INF = (long long int)1 << 61; int main(){ cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; ll t = 1 << n; vector> q(n,vector(t)); vector r(t); for(int i = 0; i < t; i++){ int tmp; for(int j = 0; j < n; j++){ cin >> tmp; q[j][i] = (bool)tmp; } cin >> tmp; r[i] = (bool)tmp; } bool allt = true; bool allf = true; int c = 0; for(int i = 0; i < t; i++){ if(r[i])c++; allt = allt && r[i]; allf = allf && (!r[i]); } if(allt){ cout << "A=⊤"; return 0; } if(allf){ cout << "A=⊥"; return 0; } cout << "A="; bool flag = false; for(int i = 0; i < t; i++){ if(r[i]){ if(flag){ cout << "∨"; } cout << "("; for(int j = 0; j < n; j++){ if(j > 0){ cout << "∧"; } if(!q[j][i]){ cout << "¬"; } cout << "P_"; std::stringstream s; s << j+1; cout << s.str(); } flag = true; } } cout <