using System;
using System.Text.RegularExpressions;
class Program
{
static string TrimMultiSpaces(string s) {
Regex regex = new Regex("[ ]{2,}", RegexOptions.None);
return regex.Replace(s, " ");
}
static void Main(string[] args)
{
string str = " c# java c c++ python ";
str = TrimMultiSpaces(str.Trim());
Console.WriteLine("(" + str + ")");
}
}
/*
run:
(c# java c c++ python)
*/