#include using namespace std; typedef long long ll; #define F first #define S second #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() const int INF = 1e9; const ll LLINF = 4e18; const double EPS = 1e-9; #define int ll void solve() { string firstline; getline(cin, firstline); istringstream firstlineiss (firstline); // cout << ">>" << firstline << "<<" << endl; int n, m; firstlineiss >> n >> m; // cout << "n=" << n << "m=" << m << endl; string l; getline(cin, l); l += "+"; // cout << ">" << l << "<" << endl; istringstream iss(l); // ii -> ostrov map iIsland; // ii -> parity map iParity; // ostrov -> oddCnt map islandOdd; // ostrov ->> evenCnt map islandEven; int currIsland = 0; int currIslandOdd = 0; int currIslandEven = 0; for (int i = 0; i < n; i++) { iIsland[i+1] = currIsland; int d; iss >> d; d %= 2; iParity[i+1] = d; d ? currIslandOdd++ : currIslandEven++; char c; iss >> skipws >> c; if (c != '*') { islandEven[currIsland] = currIslandEven; islandOdd[currIsland] = currIslandOdd; currIsland++; currIslandOdd = 0; currIslandEven = 0; } } // for (int i = 0; i < currIsland; i++) { // cout << islandOdd[i] << "=odd even=" << islandEven[i] << endl; // } int wholeParity = islandEven[0] ? 0 : 1; // cout << wholeParity << endl; for (int i = 1; i < currIsland; i++) { int curPar = islandEven[i] ? 0 : 1; // cout << curPar << endl; if (wholeParity == 0) { wholeParity = curPar; } else if (wholeParity == 1) { wholeParity = curPar == 1 ? 0 : 1; } } // cout << ">" << wholeParity << endl; cout << (wholeParity ? "odd" : "even") << endl; for (int i = 0; i < m; i++) { int x, y; cin >> x >> y; // cout << "query: " << x << " " << y << endl; y %= 2; // for (int i = 0; i < currIsland; i++) { // cout << "island=" << i << " even=" << islandEven[i] << " odd=" << islandOdd[i] << endl; //} if (iParity[x] == y) { //cout << "parity unchanged" << endl; cout << (wholeParity ? "odd" : "even") << endl; continue; } iParity[x] = y; int islandIndex = iIsland[x]; if (y) { islandOdd[islandIndex]++; islandEven[islandIndex]--; if (islandEven[islandIndex] == 0) { if (wholeParity == 0) { wholeParity = 1; } else { wholeParity = 0; } } } else { islandOdd[islandIndex]--; islandEven[islandIndex]++; if (islandEven[islandIndex] == 1) { if (wholeParity == 0) { wholeParity = 1; } else { wholeParity = 0; } } } cout << (wholeParity ? "odd" : "even") << endl; } } signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); solve(); }