#define _USE_MATH_DEFINES #include //cin, cout #include //vector #include //sort,min,max,count #include //string,getline, to_string #include //fixed #include //setprecision #include //swap, pair #include //abs(int) #include //sqrt,ceil,M_PI, pow, sin #include //stringstream,getline #include //gcd, accumlate #include //deque #include //randam_device #include //numeric_limits using namespace std; constexpr long long int D_MOD = 1000000007; int main() { string str; cin >> str; string S; int cnt = 0; for (int i = str.length() - 1; i >= 0; i--) { S.push_back(str[i]); cnt++; if (cnt == 3) { S.push_back(','); cnt = 0; } } if (S.back() == ',') { S.pop_back(); } for (int i = S.length() - 1; i >= 0; i--) { cout << S[i]; } cout << endl; return 0; }