#include using namespace std; using i8 = int8_t;using i16 = int16_t;using i32 = int32_t;using i64 = int64_t;using i128 = __int128_t;using u8 = uint8_t;using u16 = uint16_t;using u32 = uint32_t;using u64 = uint64_t;using u128 = __uint128_t;using f32 = float;using f64 = double;using f80 = long double; using vi32 = vector;using vi64 = vector;using vu32 = vector;using vu64 = vector; using vvi32 = vector>;using vvi64 = vector>;using vvu32 = vector>;using vvu64 = vector>; using pi32 = pair;using pi64 = pair;using pu32 = pair;using pu64 = pair; using vpi32 = vector;using vpi64 = vector;using vpu32 = vector;using vpu64 = vector; const i64 Mod = 1e9+7; int main() { int n; cin >> n; int t = true; int f = false; string res; for (int i = 0; i < 1 << n; i++) { vi32 vec(n); for (int j = 0; j < n; j++) cin >> vec[i]; int r; cin >> r; if (!r) { t = false; continue; } f = false; if (!res.empty()) res += "∨"; res += '('; for (int j = 0; j < n; j++) { if (i) res += "∧"; if (vec[i]) { res += "P_"; res += to_string(i + 1); } else { res += "¬P_"; res += to_string(i + 1); } } res += ')'; } cout << "A="; if (t) { cout << "⊤" << '\n'; return 0; } if (f) { cout << "⊥" << '\n'; return 0; } cout << res << '\n'; return 0; }