public class Program { public static void Main() { //int num = int.Parse(Console.ReadLine() ?? string.Empty); //string[] str = (Console.ReadLine() ?? string.Empty).Trim().Split(' '); string str = Console.ReadLine() ?? string.Empty; string k = ""; for (int i = str.Length - 1; i >= 0; i--) { k += str[i]; if ((i - 1) % 3 == 0) { k += ","; } } for(int i = k.Length - 1;i >= 0;i--) { Console.Write(k[i]); } Console.WriteLine(); //int c = 0; //for(int i = 0; i < str.Length; i++) //{ // Console.Write(str[i]); // c++; //} } }