#include<bits/stdc++.h> #define SINGLE_INPUT #define ll long long #define ull unsigned long long #define N 500005 #define MOD 998244353 usingnamespace std;
template<classt,classu> ostream& operator<<(ostream& os,const pair<t,u>& p) { return os<<'['<<p.first<<", "<<p.second<<']'; } template<classt> ostream& operator<<(ostream& os,const vector<t>& v) { os<<'['; int s = 1; for(auto e:v) { if (s) s = 0; else os << ", "; os << e; } return os<<']'; } template<classt,classu> ostream& operator<<(ostream& os,const map<t,u>& mp){ os<<'{'; int s = 1; for(auto [x,y]:mp) { if (s) s = 0; else os << ", "; os<<x<<": "<<y; } return os<<'}'; }
voidsol(){ int n, q; cin >> n >> q; string s; cin >> s; set<int> st; for (int i=0; i<n; i++) { if (s[i] == '(' && i%2) st.insert(i); if (s[i] == ')' && i%2 == 0) st.insert(i); } while (q--) { int x; cin >> x; x--; if (s[x] == '(' && x%2 == 1 || s[x] == ')' && x%2 == 0) st.erase(x); else st.insert(x);