#include "bits/stdc++.h" #pragma warning(disable:4996) using namespace std; long long int mod=1e9+7; pairmul( pair&l, pair&r) { auto p=make_pair(l.first*r.first,l.second*r.first+r.second); return make_pair(p.first%mod,p.second%mod); } pair solve(pair a, long long int b) { pairanswer(1,0); if(b==0)return answer; if (b % 2) { answer=a; } auto x=solve(a,b/2); x=mul(x,x); answer=mul(answer,x); return answer; } int main() { int N;cin>>N; vector>anss(1<>a; num+=a; } cin>>anss[i].second; anss[i].first=num; nnum+=anss[i].second; } string ans=""; if (nnum == 0) { ans="⊥"; } else if (nnum == (1 << N)) { ans="⊤"; } else { bool flag=false; for (int i = 0; i < (1 << N); ++i) { if (anss[i].second) { if (!flag) { flag=true; } else { ans += "∨"; } ans+="("; for (int j = N - 1; j >= 0; --j) { string ast; if (anss[i].first&(1 << j)) { } else { ast += "¬"; } ast+="P_"; ast+=to_string(N-j); ans+=ast; if (j) { ans += "∧"; } } ans += ")"; } } } cout<<"A="<