using System; public class Hello { static void Main() { var s = Console.ReadLine().Trim(); if (s.Length <= 3) { Console.WriteLine(s); goto exit; } var a = s.Length % 3; if (a != 0 ) Console.Write(s.Substring(0, a) + ","); put3N(s.Substring(a)); exit:; } static void put3N(string s) { var sL = s.Length; for (int i = 0; i < sL; i++) { Console.Write(s[i]); if (i % 3 == 2 && i != sL - 1) Console.Write(','); } Console.WriteLine(); } }