#include using namespace std; int main() { string s; cin >> s; reverse(s.begin(), s.end()); string t = ""; for (int i = 0; i < s.size(); i++) { t += s[i]; if ((i + 1) % 3 == 0 && i + 1 < s.size()) { t += ","; } } cout << t << endl; return 0; }