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