#include #include using namespace std; typedef long long int ll; struct Product { vector numbers; int evens; }; void dump(const map& products) { for(const auto& it:products){ cout << "end " << it.first << ":"; for (int x: it.second.numbers) { cout << ' ' << x; } cout << " (" << it.second.evens << " evens)\n"; } } int main(){ cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false); int n, q, number, position, evens = 0, totalOdds = 0; cin >> n >> q; map products; vector prodElem(1); cin >> prodElem[0]; evens = prodElem[0] % 2 == 0; char op; for (int i=1; i> op; cin >> number; //cout << "operator '" << op << "'\n"; if (op == '*') { prodElem.push_back(number); evens += number % 2 == 0; } else { products[i] = {prodElem, evens}; evens = number % 2 == 0; prodElem = vector(1, number); } } products[n] = {prodElem, evens}; for (const auto &it: products) { totalOdds += it.second.evens == 0; } //dump(products); cout << (totalOdds % 2 == 0 ? "even\n" : "odd\n"); for (int i=0; i> position >> number; position--; auto i2t = products.upper_bound(position); int beginning = int(i2t->first) - int(i2t->second.numbers.size()); totalOdds -= i2t->second.evens == 0; i2t->second.evens -= i2t->second.numbers[position - beginning] % 2 == 0; i2t->second.numbers[position - beginning] = number; i2t->second.evens += i2t->second.numbers[position - beginning] % 2 == 0; totalOdds += i2t->second.evens == 0; cout << (totalOdds % 2 == 0 ? "even\n" : "odd\n"); //dump(products); } return 0; }