#include <iostream> using namespace std; typedef long long LL; const int MAXN=40000, M=16,B=M>>1,MS=(1<< B)- 1; const LL INF = 100000000000000LL ; LL Max[MS + 4][MS + 4]; int w(int x) { int s=x; while (x) { ①; s++; } return s; } void to_max(LL &x, LL y) { if(x<y) x =y; } int main() { int n; LL ans=0; cin >> n; for(int x=0; x<=MS; x++) for(int y=0; y<=MS; y++) Max[x][y] = -INF; for(int i=1; i<=n; i++) { LL a; cin >> a; int x=②,y=a&MS; LL v=③; for(int z=0; z<=MS; z++) to_max(v,④); for(int z=0; z<=MS; z++) ⑤; to_max(ans, v); } cout << ans << endl ; return 0; }