#include "bits/stdc++.h" using namespace std; #define int long long #define REP(i,n) for(int i = 0;i < (int)(n);i++) #define RREP(i,n) for(int i = (int)n-1;i >= 0;i--) #define FOR(i,s,n) for(int i = s;i < (int)n;i++) #define RFOR(i,s,n) for(int i = (int)n-1;i >= s;i--) #define ALL(a) a.begin(),a.end() templateinline void out(T t){cout<inline void out(T t,Ts... ts){cout<inline bool CHMAX(T&a,T b){if(ainline bool CHMIN(T&a,T b){if(a>b){a = b;return true;}return false;} constexpr long long INF = 1e18; #define ull unsigned long long ull gcd(ull x,ull y) { if(x==0) return y; return gcd(y%x,x); } int lcm(int x, int y) { return (x * y / gcd(x, y)); } signed main(){ int N; cin >> N; vectora(N); vectorok(N); REP(i,N){ cin >> a[i]; if(a[i] == -1)ok[i] = 1; } RREP(i,N){ for(long long j = 0;j < 20;j++){ if(i&(1ll<