#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  int div = m / 2;
  string st, st1 = "";
  cin >> st;
  int c = 0, o = 0;
  for (int i = 0; i < st.size(); i++) {
    if (st[i] == '(') {
      if (o == div) continue;
      st1 += st[i];
      o++;
    } else {
      if (c == div) continue;
      st1 += st[i];
      c++;
    }
  }
  cout << st1 << endl;
}
