import java.util.*; public class no22{ public static void main(String... args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int k = scan.nextInt(); String s = scan.next(); int a[] = new int[n]; for(int i = 0; i < n; i++) a[i] = 0; int deep = 0,check=0,check_i=0,check_c; a[0] = deep; for(int i = 1; i < n; i++){ if(s.charAt(i) != s.charAt(i-1)){ a[i] = deep; }else{ if(s.charAt(i) == '(') deep++; else deep--; a[i] = deep; if(i == k-1){ check = deep; check_i = i; } } } int ans; for(ans = 0; ans < n; ans++){ if(a[ans] == check && check_i != ans){ System.out.println(ans+1); } } } }