namespace hdk{
const size_t fixsize=10000;
class StringAddition_InFix{
private:
string x="00";
inline void fixed(int size){
if(size<=x.length())return;
string res;
for(int i=1;i<=size-x.length();++i){
res.push_back('0');
}
for(int i=0;i<=x.length()-1;++i){
res.push_back(x[i]);
}
x=res;
}
inline void refixed(){
string res;bool is0=false;
res.push_back('0');
for(int i=0;i<=x.length()-1;++i){
if(x[i]!='0'||is0){
is0=true;
res.push_back(x[i]);
}
}
x=res;
}
public:
void operator =(string inx){
x.push_back('0');
for(int i=0;i<=inx.length()-1;++i){
x.push_back(inx[i]);
}
}
void operator =(long long inx){
x.clear();string ans;
int r=inx;
while(r){
ans.push_back(r%10+'0');
r/=10;
}
x.push_back('0');
for(int i=ans.size()-1;i>=0;--i){
x.push_back(ans[i]);
}
}
string it(){
string res;
for(int i=1;i<=x.length()-1;++i){
res.push_back(x[i]);
}
if(res.empty()) res="0";
return res;
}
StringAddition_InFix operator +(StringAddition_InFix a){
StringAddition_InFix ans;ans=a;
if(x.length()>ans.x.length()){
ans.fixed(x.length());
}
else fixed(ans.x.length());
for(int i=max(x.length(),ans.x.length())-1;i>=1;--i){
int np=(ans.x[i]-'0'+x[i]-'0');
if(np>=10) ans.x[i-1]+=np/10;
ans.x[i]=np%10+'0';
}
ans.refixed();refixed();
return ans;
}
StringAddition_InFix operator +(long long a){
StringAddition_InFix r;r=a;
return *this+r;
}
void operator +=(StringAddition_InFix a){
*this=*this+a;
}
void operator +=(long long a){
*this=*this+a;
}
friend ostream& operator<<(ostream& output,StringAddition_InFix& inx){
output<<inx.it()<<endl;
return output;
}
friend istream& operator>>(istream& input,StringAddition_InFix& inx){
input>>inx.x;
inx.fixed(inx.x.length()+1);
return input;
}
};
typedef StringAddition_InFix Int;
Int max(Int &la,Int &lb){
if(la.it()>lb.it()) return la;
else return lb;
}
Int min(Int &la,Int &lb){
if(la.it()<lb.it()) return lb;
else return la;
}
}