#include #include #include #include #include #include #include using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; ll s = 0; for (int i = 0; i < n; i++) { int a; cin >> a; if (a % 2) { s += a; } else if (s) { cout << s << '\n'; s = 0; } } if (s) cout << s << '\n'; return 0; }