using System.Collections.Generic; using System; public class Hello { public static void Main() { var st = new Stack(); var n = int.Parse(Console.ReadLine().Trim()); var a = new int[n]; var s = Console.ReadLine().Trim(); for (int i = 0; i < n; i++) if (s[i] == '(') st.Push(i); else { var w = st.Pop(); a[w] = i; a[i] = w; } for (int i = 0; i < n; i++) Console.WriteLine(a[i] + 1); } }