#include using namespace std; int main(){ int n; cin >> n; vector tb(1 << n); string ans = "A="; for(int i = 0; i < (1 << n); i++){ int s = 0, v; string str = "("; for(int j = 0; j < n; j++){ if(j)str += "∧"; cin >> v; s <<= 1; s |= v; if(v == 0)str += "¬"; str += "P_" + to_string(j + 1); } str += ")"; cin >> v; if(v){ tb[s] = true; if(ans.back() != '=')ans += "∨"; ans += str; } } int cnt = count(tb.begin(), tb.end(), true); if(cnt == (1 << n) || cnt == 0){ cout << "A=" << (cnt == (1 << n) ? "⊤" : "⊥") << '\n'; return 0; } cout << ans << '\n'; }