#include using namespace std; using uint = unsigned int; using lint = long long int; using ulint = unsigned long long int; template using V = vector; template using VV = V< V >; template void assign(V& v, int n, const U& a) { v.assign(n, a); } template void assign(V& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); } int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); string s; cin >> s; int n = s.size(); string res; for (int i = 0; i < n; ++i) { res += s[n - 1 - i]; if (i != n - 1 and i % 3 == 2) res += ','; } reverse(begin(res), end(res)); cout << res << '\n'; }