#include typedef long long ll; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,a) FOR(i,0,a) using namespace std; vector ans; int main(){ ll N; scanf("%lld",&N); if(N==0){ ans.push_back(0); } while(N>0){ ans.push_back(N%1000); N/=1000; } REP(i,(int)ans.size()){ if(i)printf(","); printf("%lld",ans[(int)ans.size()-1-i]); } printf("\n"); }