#include <iostream> #include<math.h> #include<stdlib.h> using namespace std; void sum(int a,int b){ int ans=a+b; int remainder,core,remainder2; if((abs(ans)>=0)&&(abs(ans)<1000)){ cout<<ans<<endl; } if((abs(ans)>=1000)&&(abs(ans)<1000000)){ remainder=ans%1000; core=(ans-remainder)/1000; if(abs(remainder)>99) cout<<core<<","<<abs(remainder)<<endl; if((abs(remainder)<=99)&&(abs(remainder)>=10)) cout<<core<<",0"<<abs(remainder)<<endl; if((abs(remainder)<=9)&&(abs(remainder)>=0)) cout<<core<<",00"<<abs(remainder)<<endl; } if((abs(ans)>=1000000)){ remainder=ans%1000000; core=(ans-remainder)/1000000; remainder2=remainder%1000; remainder=(remainder-remainder2)/1000; if((abs(remainder)>99)&&(abs(remainder2)>99)) cout<<core<<","<<abs(remainder)<<","<<abs(remainder2)<<endl; if((abs(remainder)>99)&&(abs(remainder2)<=99)&&(abs(remainder2)>=10)) cout<<core<<","<<abs(remainder)<<",0"<<abs(remainder2)<<endl; if((abs(remainder)>99)&&(abs(remainder2)<=9)&&(abs(remainder2)>=0)) cout<<core<<","<<abs(remainder)<<",00"<<abs(remainder2)<<endl; if((abs(remainder)<=99)&&(abs(remainder)>=10)&&(abs(remainder2)>99)) cout<<core<<",0"<<abs(remainder)<<","<<abs(remainder2)<<endl; if((abs(remainder)<=99)&&(abs(remainder)>=10)&&(abs(remainder2)<=99)&&(abs(remainder2)>=10)) cout<<core<<",0"<<abs(remainder)<<",0"<<abs(remainder2)<<endl; if((abs(remainder)<=99)&&(abs(remainder)>=10)&&(abs(remainder2)<=9)&&(abs(remainder2)>=0)) cout<<core<<",0"<<abs(remainder)<<",00"<<abs(remainder2)<<endl; if((abs(remainder)<=9)&&(abs(remainder)>=0)&&(abs(remainder2)>99)) cout<<core<<",00"<<abs(remainder)<<","<<abs(remainder2)<<endl; if((abs(remainder)<=9)&&(abs(remainder)>=0)&&(abs(remainder2)<=99)&&(abs(remainder2)>=10)) cout<<core<<",00"<<abs(remainder)<<",0"<<abs(remainder2)<<endl; if((abs(remainder)<=9)&&(abs(remainder)>=0)&&(abs(remainder2)<=9)&&(abs(remainder2)>=0)) cout<<core<<",00"<<abs(remainder)<<",00"<<abs(remainder2)<<endl; } } int main() { int a,b; cin>>a>>b; sum(a,b); return 0; }