#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,sse,sse2,sse3,sse4,popcnt,fma")
#pragma GCC optimize("unroll-loops")
typedef long long int ll;
typedef long double ld;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL)
#define endl '\n'
#define pb push_back
#define conts continue
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(), a.rend()
#define yes cout << "Yes" << endl
#define no cout << "No" << endl
#define ff first
#define ss second
#define ceil2(x,y) (x+y-1) / y
#define sz(a) a.size()
#define setbits(x) __builtin_popcountll(x)
#ifndef ONLINE_JUDGE
#define debug(x) cout << #x <<" = "; print(x); cout << endl;
#else
#define debug(x)
#endif
bool iseven(ll n) {if ((n & 1) == 0) return true; return false;}
void print(ll t) {cout << t;}
void print(int t) {cout << t;}
void print(string t) {cout << t;}
void print(char t) {cout << t;}
void print(double t) {cout << t;}
void print(ld t) {cout << t;}
template <class T, class V> void print(pair <T, V> p);
template <class T> void print(vector <T> v);
template <class T> void print(set <T> v);
template <class T, class V> void print(map <T, V> v);
template <class T> void print(multiset <T> v);
template <class T, class V> void print(pair <T, V> p) {cout << "{"; print(p.ff); cout << ","; print(p.ss); cout << "}";}
template <class T> void print(vector <T> v) {cout << "[ "; for (T i : v) {print(i); cout << " ";} cout << "]";}
template <class T> void print(set <T> v) {cout << "[ "; for (T i : v) {print(i); cout << " ";} cout << "]";}
template <class T> void print(multiset <T> v) {cout << "[ "; for (T i : v) {print(i); cout << " ";} cout << "]";}
template <class T, class V> void print(map <T, V> v) {cout << "[ "; for (auto i : v) {print(i); cout << " ";} cout << "]";}
const ll MOD = 1e9 + 7;
const ll maxn = 1e5 + 5;
const ll inf = 1e18;
struct segtree {
/*=======================================================*/
struct stnode {
ll minpref, sum;
};
ll siz = 1;
vector<stnode> arr;
stnode NEUTRAL_STNODE = {0,0};
void merge(stnode &curr, stnode &left, stnode &right) {
curr.minpref = min(left.minpref, left.sum + right.minpref);
curr.sum = left.sum + right.sum;
}
stnode convert(ll n) {
return {n,n};
}
/*=======================================================*/
void init(ll n) {
while (siz < n) {
siz *= 2;
}
arr.assign(2 * siz, NEUTRAL_STNODE);
}
void build(vector<ll> &a, ll n, ll x, ll lx, ll rx) {
if (rx - lx == 1) {
if (lx < n) {
arr[x] = convert(a[lx]);
}
return;
}
ll mid = (lx + rx) / 2;
build(a, n, 2 * x + 1, lx, mid);
build(a, n, 2 * x + 2, mid, rx);
merge(arr[x], arr[2 * x + 1], arr[2 * x + 2]);
}
void pupd(ll i, ll v, ll x, ll lx, ll rx) {
if (rx - lx == 1) {
arr[x] = convert(v);
return;
}
ll mid = (lx + rx) / 2;
if (i < mid) {
pupd(i, v, 2 * x + 1, lx, mid);
}
else {
pupd(i, v, 2 * x + 2, mid, rx);
}
merge(arr[x], arr[2 * x + 1], arr[2 * x + 2]);
}
stnode query(ll l, ll r, ll x, ll lx, ll rx) {
if (lx >= r || rx <= l) {
return NEUTRAL_STNODE;
}
if (lx >= l && rx <= r) {
return arr[x];
}
ll mid = (lx + rx) / 2;
stnode curr;
stnode left = query(l, r, 2 * x + 1, lx, mid);
stnode right = query(l, r, 2 * x + 2, mid, rx);
merge(curr, left, right);
return curr;
}
void build(vector<ll> &a, ll n) {
build(a, n, 0, 0, siz);
}
void pupd(ll i, ll v) {
pupd(i, v, 0, 0, siz);
}
stnode query(ll l, ll r) {
return query(l, r, 0, 0, siz);
}
};
void solve()
{
ll n, q; cin >> n >> q;
string s; cin >> s;
vector<ll> a(n);
for (ll i = 0; i < n; ++i) {
if (s[i] == '(') {
a[i] = 1;
}
else {
a[i] = -1;
}
}
segtree st;
st.init(n);
st.build(a,n);
while (q--) {
ll op, l, r; cin >> op >> l >> r;
l--, r--;
if (op == 1) {
swap(a[l], a[r]);
st.pup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IG1lcmdlKHN0bm9kZSAmY3Vyciwgc3Rub2RlICZsZWZ0LCBzdG5vZGUgJnJpZ2h0KSB7CiAgICAgICAgY3Vyci5taW5wcmVmID0gbWluKGxlZnQubWlucHJlZiwgbGVmdC5zdW0gKyByaWdodC5taW5wcmVmKTsKICAgICAgICBjdXJyLnN1bSA9IGxlZnQuc3VtICsgcmlnaHQuc3VtOwogICAgfQoKICAgIHN0bm9kZSBjb252ZXJ0KGxsIG4pIHsKICAgICAgICByZXR1cm4ge24sbn07CiAgICB9CgogICAgLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KCiAgICB2b2lkIGluaXQobGwgbikgewogICAgICAgIHdoaWxlIChzaXogPCBuKSB7CiAgICAgICAgICAgIHNpeiAqPSAyOwogICAgICAgIH0KCiAgICAgICAgYXJyLmFzc2lnbigyICogc2l6LCBORVVUUkFMX1NUTk9ERSk7CiAgICB9CgogICAgdm9pZCBidWlsZCh2ZWN0b3I8bGw+ICZhLCBsbCBuLCBsbCB4LCBsbCBseCwgbGwgcngpIHsKICAgICAgICBpZiAocnggLSBseCA9PSAxKSB7CiAgICAgICAgICAgIGlmIChseCA8IG4pIHsKICAgICAgICAgICAgICAgIGFyclt4XSA9IGNvbnZlcnQoYVtseF0pOwogICAgICAgICAgICB9CgogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQoKICAgICAgICBsbCBtaWQgPSAobHggKyByeCkgLyAyOwoKICAgICAgICBidWlsZChhLCBuLCAyICogeCArIDEsIGx4LCBtaWQpOwogICAgICAgIGJ1aWxkKGEsIG4sIDIgKiB4ICsgMiwgbWlkLCByeCk7CgogICAgICAgIG1lcmdlKGFyclt4XSwgYXJyWzIgKiB4ICsgMV0sIGFyclsyICogeCArIDJdKTsKICAgIH0KCiAgICB2b2lkIHB1cGQobGwgaSwgbGwgdiwgbGwgeCwgbGwgbHgsIGxsIHJ4KSB7CiAgICAgICAgaWYgKHJ4IC0gbHggPT0gMSkgewogICAgICAgICAgICBhcnJbeF0gPSBjb252ZXJ0KHYpOwogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQoKICAgICAgICBsbCBtaWQgPSAobHggKyByeCkgLyAyOwoKICAgICAgICBpZiAoaSA8IG1pZCkgewogICAgICAgICAgICBwdXBkKGksIHYsIDIgKiB4ICsgMSwgbHgsIG1pZCk7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBwdXBkKGksIHYsIDIgKiB4ICsgMiwgbWlkLCByeCk7CiAgICAgICAgfQoKICAgICAgICBtZXJnZShhcnJbeF0sIGFyclsyICogeCArIDFdLCBhcnJbMiAqIHggKyAyXSk7CiAgICB9CgogICAgc3Rub2RlIHF1ZXJ5KGxsIGwsIGxsIHIsIGxsIHgsIGxsIGx4LCBsbCByeCkgewogICAgICAgIGlmIChseCA+PSByIHx8IHJ4IDw9IGwpIHsKICAgICAgICAgICAgcmV0dXJuIE5FVVRSQUxfU1ROT0RFOwogICAgICAgIH0KCiAgICAgICAgaWYgKGx4ID49IGwgJiYgcnggPD0gcikgewogICAgICAgICAgICByZXR1cm4gYXJyW3hdOwogICAgICAgIH0KCiAgICAgICAgbGwgbWlkID0gKGx4ICsgcngpIC8gMjsKCiAgICAgICAgc3Rub2RlIGN1cnI7CiAgICAgICAgc3Rub2RlIGxlZnQgPSBxdWVyeShsLCByLCAyICogeCArIDEsIGx4LCBtaWQpOwogICAgICAgIHN0bm9kZSByaWdodCA9IHF1ZXJ5KGwsIHIsIDIgKiB4ICsgMiwgbWlkLCByeCk7CgogICAgICAgIG1lcmdlKGN1cnIsIGxlZnQsIHJpZ2h0KTsKCiAgICAgICAgcmV0dXJuIGN1cnI7CiAgICB9CgogICAgdm9pZCBidWlsZCh2ZWN0b3I8bGw+ICZhLCBsbCBuKSB7CiAgICAgICAgYnVpbGQoYSwgbiwgMCwgMCwgc2l6KTsKICAgIH0KCiAgICB2b2lkIHB1cGQobGwgaSwgbGwgdikgewogICAgICAgIHB1cGQoaSwgdiwgMCwgMCwgc2l6KTsKICAgIH0KCiAgICBzdG5vZGUgcXVlcnkobGwgbCwgbGwgcikgewogICAgICAgIHJldHVybiBxdWVyeShsLCByLCAwLCAwLCBzaXopOwogICAgfQp9OwoKdm9pZCBzb2x2ZSgpCnsKICAgIGxsIG4sIHE7IGNpbiA+PiBuID4+IHE7CiAgICBzdHJpbmcgczsgY2luID4+IHM7CiAgICB2ZWN0b3I8bGw+IGEobik7CiAgICBmb3IgKGxsIGkgPSAwOyBpIDwgbjsgKytpKSB7CiAgICAgICAgaWYgKHNbaV0gPT0gJygnKSB7CiAgICAgICAgICAgIGFbaV0gPSAxOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgYVtpXSA9IC0xOwogICAgICAgIH0KICAgIH0KCiAgICBzZWd0cmVlIHN0OwogICAgc3QuaW5pdChuKTsKICAgIHN0LmJ1aWxkKGEsbik7CgogICAgd2hpbGUgKHEtLSkgewogICAgICAgIGxsIG9wLCBsLCByOyBjaW4gPj4gb3AgPj4gbCA+PiByOwogICAgICAgIGwtLSwgci0tOwoKICAgICAgICBpZiAob3AgPT0gMSkgewogICAgICAgICAgICBzd2FwKGFbbF0sIGFbcl0pOwogICAgICAgICAgICBzdC5wdXBkKGwsIGFbbF0pOwogICAgICAgICAgICBzdC5wdXBkKHIsIGFbcl0pOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgYXV0byByZXMgPSBzdC5xdWVyeShsLCByICsgMSk7CiAgICAgICAgICAgIGlmIChyZXMubWlucHJlZiA+PSAwICYmIHJlcy5zdW0gPT0gMCkgewogICAgICAgICAgICAgICAgeWVzOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgbm87CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0KCnNpZ25lZCBtYWluKCkKewogICAgZmFzdGlvOwogICAgc29sdmUoKTsKICAgIHJldHVybiAwOwp9