import strutils, sequtils let t = stdin.readLine.split.map(parseInt) (n, k) = (t[0], t[1]) var s = stdin.readLine i = s.high L, R: seq[int] = @[] while s.count('(') > 0: i -= 1 if s[i] == '(': s[i] = 'x' L.add(i + 1) var j = i + 1 while s[j] != ')': j += 1 s[j] = 'x' R.add(j + 1) if k in L: echo R[L.find(k)] else: echo L[R.find(k)]