constint up =10;constint M =1000;structHigh{int c[up +5];voidout(){int poi = up;while(poi >=1&& c[poi]==0) poi--;write(c[poi--]);while(poi >=1)printf("%03d", c[poi--]);}High(){memset(c,0,sizeof c);}High(int x){int poi =1;while(x){
c[poi++]= x % M;
x /= M;}while(poi <= up)
c[poi++]=0;}};booloperator<(High x, High y){for(int i = up; i >=1; i--){if(x.c[i]< y.c[i])return1;if(x.c[i]> y.c[i])return0;}return0;}booloperator>(High x, High y){for(int i = up; i >=1; i--){if(x.c[i]> y.c[i])return1;if(x.c[i]< y.c[i])return0;}return0;}booloperator==(High x, High y){for(int i = up; i >=1; i--)if(x.c[i]!= y.c[i])return0;return1;}
High operator+(High x, High y){
High res;for(int i =1; i <= up; i++){
res.c[i]+= x.c[i]+ y.c[i];
res.c[i +1]+= res.c[i]/ M;
res.c[i]%= M;}return res;}
High operator*(High x, High y){
High res;for(int i =1; i <= up; i++){for(int j =1; j <= up && i + j -1<= up; j++){
res.c[i + j -1]+= x.c[i]* y.c[j];
res.c[i + j]+= res.c[i + j -1]/ M;
res.c[i + j -1]%= M;}}return res;}
High operator-(High x, High y){
High res;for(int i =1; i <= up; i++){
res.c[i]= x.c[i]- y.c[i];if(res.c[i]<0){
res.c[i]+= M;
res.c[i +1]-=1;}}return res;}
2.普通(全)
template<typenameT> T Max(T x, T y){return x > y ? x : y;}template<typenameT> T Min(T x, T y){return x < y ? x : y;}template<typenameT> T Abs(T x){return x >0? x :-x;}structhigh_precision{
vector <int> c;high_precision(){
c.clear();}voidcolour(int len){while(c.size()< len) c.push_back(0);}voidoperator=(const string x){
c.resize(x.size());for(int i =0; i < x.size(); i++){
c[x.size()- i -1]= x[i]-'0';}}voidoperator=(int tem){
string x; x.clear();while(tem){
x += tem %10+'0';
tem /=10;}reverse(x.begin(), x.end());
c.resize(x.size());for(int i =0; i < x.size(); i++){
c[x.size()- i -1]= x[i]-'0';}}voidoperator=(LL tem){
string x; x.clear();while(tem){
x += tem %10+'0';
tem /=10;}reverse(x.begin(), x.end());
c.resize(x.size());for(int i =0; i < x.size(); i++){
c[x.size()- i -1]= x[i]-'0';}}voidinout(){if(c.size()==0){putchar('0');}else{if(c[c.size()-1]<0){putchar('-');for(int i = c.size()-1; i >=0; i--){printf("%d",Abs(c[i]));}}else{for(int i = c.size()-1; i >=0; i--){printf("%d", c[i]);}}}}};template<typenameT>
high_precision Change(T x){
string tem; tem.clear();
high_precision ans;while(x){
tem += x %10+'0';
x /=10;}reverse(tem.begin(), tem.end());
ans = tem;return ans;}booloperator<(high_precision x, high_precision y){int lenx = x.c.size(), leny = y.c.size();if(x.c[lenx -1]<0&& y.c[leny -1]<0){if(lenx != leny)return lenx > leny;else{for(int i = lenx -1; i >=0; i--){if(x.c[i]!= y.c[i]){return x.c[i]< y.c[i];}}return0;}}elseif(x.c[lenx -1]<0&& y.c[leny -1]>0){return1;}elseif(x.c[lenx -1]>0&& y.c[leny -1]<0){return0;}else{if(lenx != leny)return lenx < leny;else{for(int i = lenx -1; i >=0; i--){if(x.c[i]!= y.c[i]){return x.c[i]< y.c[i];}}return0;}}}booloperator>(high_precision x, high_precision y){return y < x;}booloperator==(high_precision x, high_precision y){if(x.c.size()!= y.c.size())return0;for(int i = x.c.size()-1; i >=0; i--){if(x.c[i]!= y.c[i])return0;}return1;}booloperator>=(high_precision x, high_precision y){if(x > y)return1;elseif(x == y)return1;elsereturn0;}booloperator<=(high_precision x, high_precision y){if(x < y)return1;elseif(x == y)return1;elsereturn0;}
high_precision operator*(high_precision x, high_precision y){
high_precision ans;
ans.colour(x.c.size()+ y.c.size());for(int i =0; i < x.c.size(); i++){for(int j =0; j < y.c.size(); j++){
ans.c[i + j]+= x.c[i]* y.c[j];
ans.c[i + j +1]+= ans.c[i + j]/10;
ans.c[i + j]%=10;}}while(ans.c.size()>=1&& ans.c[ans.c.size()-1]==0) ans.c.pop_back();return ans;}template<typenameT>
high_precision operator*(high_precision a, T y){return a *Change(y);}
high_precision operator+(high_precision x, high_precision y){
high_precision ans;int len =Max(x.c.size(), y.c.size());
ans.colour(len +1);
x.colour(len);
y.colour(len);for(int i =0; i < len; i++){
ans.c[i]+= x.c[i]+ y.c[i];
ans.c[i +1]+= ans.c[i]/10;
ans.c[i]%=10;}while(ans.c.size()>=1&& ans.c[ans.c.size()-1]==0) ans.c.pop_back();return ans;}template<typenameT>
high_precision operator+(high_precision a, T y){return a +Change(y);}
high_precision operator-(high_precision x, high_precision y){
high_precision ans;int len =Max(x.c.size(), y.c.size())+3;
x.colour(len); y.colour(len); ans.colour(len);bool check =0;if(x < y)swap(x, y), check =1;int flag =0;for(int i =0; i < ans.c.size(); i++){
ans.c[i]= x.c[i]- y.c[i]+ flag;if(ans.c[i]<0){
ans.c[i]+=10;
flag =-1;}else{
flag =0;}}if(check){for(int i =0; i < ans.c.size(); i++){
ans.c[i]=-ans.c[i];}}while(ans.c.size()>=1&& ans.c[ans.c.size()-1]==0) ans.c.pop_back();return ans;}template<typenameT>
high_precision operator-(high_precision a, T y){return a -Change(y);}
high_precision operator/(high_precision x, high_precision y){
high_precision ans, flag;
ans.colour(x.c.size());for(int i = x.c.size()-1; i >=0; i--){
flag.c.insert(flag.c.begin(), x.c[i]);int Index;for(int j =1; j <=10; j++){
high_precision res;
res = y * j;
Index = j;if(res > flag)break;}
high_precision res;
res = y *(Index -1);
flag = flag - res;
ans.c[i]= Index -1;}while(ans.c.size()>=1&& ans.c[ans.c.size()-1]==0) ans.c.pop_back();return ans;}template<typenameT>
high_precision operator/(high_precision x, T y){return x /Change(y);}
high_precision operator%(high_precision x, high_precision y){
high_precision res = x / y;return x - res * y;}template<typenameT>
high_precision operator%(high_precision a, T y){return a %Change(y);}
3.压位
template<typenameT> T Max(T x, T y){return x > y ? x : y;}template<typenameT> T Min(T x, T y){return x < y ? x : y;}template<typenameT> T Abs(T x){return x >0? x :-x;}constint Mod =10000;structhigh_precision{
vector <int> c;high_precision(){
c.clear();}voidcolour(int len){while(c.size()< len) c.push_back(0);}voidoperator=(const string x){
c.resize(x.length());for(int i =0, j =0; i < x.length(); i +=4, j++){for(int k =0; k <4; k++){
c[j]= c[j]*10+ x[k + j];}}}voidoperator=(int tem){
vector <int> x; x.clear();while(tem){
x.push_back(tem % Mod);
tem /= Mod;}reverse(x.begin(), x.end());
c.resize(x.size());for(int i =0; i < x.size(); i++){
c[x.size()- i -1]= x[i];}}voidoperator=(LL tem){
string x; x.clear();while(tem){
x += tem % Mod +'0';
tem /= Mod;}reverse(x.begin(), x.end());
c.resize(x.size());for(int i =0; i < x.size(); i++){
c[x.size()- i -1]= x[i]-'0';}}voidinout(){if(c.size()==0){putchar('0');}else{if(c[c.size()-1]<0){putchar('-');for(int i = c.size()-1; i >=0; i--){if(i != c.size()-1)printf("%04d",Abs(c[i]));elseprintf("%d",Abs(c[i]));}}else{for(int i = c.size()-1; i >=0; i--){if(i != c.size()-1)printf("%04d",Abs(c[i]));elseprintf("%d",Abs(c[i]));}}}}};template<typenameT>
high_precision Change(T x){
string tem; tem.clear();
high_precision ans;while(x){
tem += x % Mod +'0';
x /= Mod;}reverse(tem.begin(), tem.end());
ans = tem;return ans;}booloperator<(high_precision x, high_precision y){int lenx = x.c.size(), leny = y.c.size();if(x.c[lenx -1]<0&& y.c[leny -1]<0){if(lenx != leny)return lenx > leny;else{for(int i = lenx -1; i >=0; i--){if(x.c[i]!= y.c[i]){return x.c[i]< y.c[i];}}return0;}}elseif(x.c[lenx -1]<0&& y.c[leny -1]>0){return1;}elseif(x.c[lenx -1]>0&& y.c[leny -1]<0){return0;}else{if(lenx != leny)return lenx < leny;else{for(int i = lenx -1; i >=0; i--){if(x.c[i]!= y.c[i]){return x.c[i]< y.c[i];}}return0;}}}booloperator>(high_precision x, high_precision y){return y < x;}booloperator==(high_precision x, high_precision y){if(x.c.size()!= y.c.size())return0;for(int i = x.c.size()-1; i >=0; i--){if(x.c[i]!= y.c[i])return0;}return1;}booloperator>=(high_precision x, high_precision y){if(x > y)return1;elseif(x == y)return1;elsereturn0;}booloperator<=(high_precision x, high_precision y){if(x < y)return1;elseif(x == y)return1;elsereturn0;}
high_precision operator*(high_precision x, high_precision y){// printf ("x: "); x.inout (); printf ("\ny: "); y.inout (); printf ("\n");
high_precision ans;
ans.colour(x.c.size()+ y.c.size());for(int i =0; i < x.c.size(); i++){for(int j =0; j < y.c.size(); j++){
ans.c[i + j]+= x.c[i]* y.c[j];
ans.c[i + j +1]+= ans.c[i + j]/ Mod;
ans.c[i + j]%= Mod;}}while(ans.c.size()>=1&& ans.c[ans.c.size()-1]==0) ans.c.pop_back();// printf ("ans: "); ans.inout (); printf ("\n");return ans;}template<typenameT>
high_precision operator*(high_precision a, T y){return a *Change(y);}
high_precision operator+(high_precision x, high_precision y){
high_precision ans;int len =Max(x.c.size(), y.c.size());
ans.colour(len +1);
x.colour(len);
y.colour(len);for(int i =0; i < len; i++){
ans.c[i]+= x.c[i]+ y.c[i];
ans.c[i +1]+= ans.c[i]/ Mod;
ans.c[i]%= Mod;}while(ans.c.size()>=1&& ans.c[ans.c.size()-1]==0) ans.c.pop_back();return ans;}template<typenameT>
high_precision operator+(high_precision a, T y){return a +Change(y);}
high_precision operator-(high_precision x, high_precision y){
high_precision ans;int len =Max(x.c.size(), y.c.size())+3;
x.colour(len); y.colour(len); ans.colour(len);bool check =0;if(x < y)swap(x, y), check =1;int flag =0;for(int i =0; i < ans.c.size(); i++){
ans.c[i]= x.c[i]- y.c[i]+ flag;if(ans.c[i]<0){
ans.c[i]+= Mod;
flag =-1;}else{
flag =0;}}if(check){for(int i =0; i < ans.c.size(); i++){
ans.c[i]=-ans.c[i];}}while(ans.c.size()>=1&& ans.c[ans.c.size()-1]==0) ans.c.pop_back();return ans;}template<typenameT>
high_precision operator-(high_precision a, T y){return a -Change(y);}
high_precision operator/(high_precision x, high_precision y){
high_precision ans, flag;
ans.colour(x.c.size());for(int i = x.c.size()-1; i >=0; i--){
flag.c.insert(flag.c.begin(), x.c[i]);int Index;for(int j =1; j < Mod; j++){
high_precision res;
res = y * j;
Index = j;if(res > flag)break;}
high_precision res;
res = y *(Index -1);
flag = flag - res;
ans.c[i]= Index -1;}while(ans.c.size()>=1&& ans.c[ans.c.size()-1]==0) ans.c.pop_back();return ans;}template<typenameT>
high_precision operator/(high_precision x, T y){return x /Change(y);}
high_precision operator%(high_precision x, high_precision y){
high_precision res = x / y;return x - res * y;}template<typenameT>
high_precision operator%(high_precision a, T y){return a %Change(y);}