#include int isEven(char exprtk[], int nums[], int N) { int multip_ns[N], newExp[N - 1]; for (int i = 0; i < N; i++) { multip_ns[i] = nums[i]; } for (int i = 0; i < N - 1; i++) { if (exprtk[i] == '*') { printf("Hi"); multip_ns[i] = multip_ns[i] * multip_ns[i + 1]; if (i <= N - 1) multip_ns[i + 1] = multip_ns[i + 2]; } else newExp[i] = exprtk[i]; } int result = 0; for (int i = 0; i < N - 1; i++) { if (exprtk[i] == '+') result += multip_ns[i + 1]; if (exprtk[i] == '-') result -= multip_ns[i + 1]; } /* int step = 0; int r = 0; for (int i = 0; i < N - 1; i++) { if (exprtk[i] == '*') { if(step==0) multip_ns[step] = nums[i] * nums[i + 1]; if (i <= N - 1) i++; step++; } else multip_ns[i] = nums[i]; } */ if (result % 2 == 0) return 1; else return 0; } int main() { int N, M; char token, exprtk[N - 1]; int nums[N]; scanf("%d %d", &N, &M); for (int i = 0; i < N; i++) { if(i < N - 1) { scanf("%d %c", &nums[i], &token); exprtk[i] = token; } else scanf("%d", &nums[i]); } if (isEven(exprtk, nums, N) == 1) { printf("even\n"); } else { printf("odd\n"); } int pos, change; for (int i = 0; i < M; i++) { scanf("%d %d", &pos, &change); nums[pos] = change; if (isEven(exprtk, nums, N) == 1) { printf("even\n"); } else { printf("odd\n"); } } return 0; }