#include using namespace std; int main() { string s; cin >> s; string a = ""; int c = 0; for (int i = s.size()-1; 0 <= i; i--) { if (c == 3) { a.push_back(','); c = 0; } a.push_back(s.at(i)); c++; } for (int i = a.size()-1; i >= 0; i--) { cout << a.at(i); if (i == 0) { cout << endl; } } }