using System; using System.Text; namespace ConsoleApp4 { class Program { static void Main(string[] args) { string sosatHuj = Console.ReadLine(); StringBuilder str = new StringBuilder(sosatHuj); int count = 0; int count2 = 0; for (int i = 0; i < str.Length - 1; i++) { if (str[i] == '(') { if (count == 1) { str[i] = '['; } else if (count > 1) { str[i] = '{'; } count++; } } for (int i = str.Length - 1; i > 0; i--) { if (str[i] == ')') { if (count2 == 1) { str[i] = ']'; } if (count2 > 1) { str[i] = '}'; } count2++; } } Console.WriteLine(str); Console.ReadKey(); } } }