using System; using System.Collections.Generic; using System.Linq; namespace _22 { class Program { static void Main(string[] args) { Stack stack = new Stack(); int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray(); string s = Console.ReadLine(); for (int i = 1; i <= x[0]; i++) { if (s[i - 1] == '(') stack.Push(i); else { if (i == x[1]) Console.WriteLine(stack.Peek()); else if (stack.Peek() == x[1]) Console.WriteLine(i); stack.Pop(); } } } } }