#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define BET(a,b,c) ((a)<=(b)&&(b)<(c)) #define FOR(i,n) for(int i=0,i##_end=(int(n));i VI; typedef vector VVI; int main() { int D; cin>>D; vector a(D + 1); FOR(i,SZ(a)) cin>>a[i]; reverse(ALL(a)); FOR(i,SZ(a)-3){ a[i+2] += a[i]; a[i] = 0; } while(SZ(a) > 1 && a[0] == 0) a.erase(a.begin()); reverse(ALL(a)); cout<