#include using namespace std; int main() { string s; cin >> s; int n = s.size(); string ans = ""; int cnt = 0; for (int i = n - 1; i >= 0; --i) { if (cnt == 3) { cnt = 0; ans += ','; } cnt++; ans += s[i]; } reverse(ans.begin(), ans.end()); cout << ans << '\n'; }