#include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i = 0; i < (n); ++i) #define P(x) cout << (x) << "\n" #define D(x) cerr << (x) << "\n" #define fcout cout << fixed << setprecision(18) using i64=long long int; // 10^18 int main(){ ios::sync_with_stdio(false); cin.tie(0); string n;cin>>n; string r = regex_replace(n, regex("(\\d)(?=(\\d{3})+$)"), "$1,"); P(r); return 0; }