#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<stdexcept>
using namespace std;
class integer
{
friend istream& operator>>(istream& is,integer&);
friend ostream& operator<<(ostream& os,const integer&);//
friend bool operator>(const integer &,const integer&);//
friend bool operator<(const integer &,const integer&);//
friend bool operator>=(const integer &,const integer&);//
friend bool operator<=(const integer &,const integer&);//
friend bool operator==(const integer &,const integer&);//
friend bool operator!=(const integer &,const integer&);//
friend integer operator+(const integer&,const integer&);//
friend integer operator-(const integer&,const integer&);//
friend integer operator*(const integer&,const integer&);//
friend integer operator/(const integer&,const integer&);//
friend integer operator%(const integer&,const integer&);//
friend integer abs(const integer&);//
friend integer operator-(const integer& num);//
public:
integer& operator=(const integer &);//
integer& operator++();
integer operator++(int);
integer& operator--();
integer operator--(int);
integer& operator+=(const integer&);
integer& operator-=(const integer&);
integer& operator*=(const integer&);
integer& operator/=(const integer&);
integer& operator%=(const integer&);
integer(const char* s="0");//
integer(const long long int& num);//
integer(const integer& num);//
virtual ~integer();//
private:
struct _int
{
public:
_int(const char*str="0");
_int(const long long&);
_int(const _int&);
void show()const;
~_int();
_int(size_t,short);
static _int add(const _int&,const _int&);
static _int sub(const _int&,const _int&);
static _int mul(const _int&,const _int&);
static _int div(const _int&,const _int&);
static _int mod(const _int&,const _int&);
static void intcpy(_int&,const _int&);
static bool big(const _int&,const _int&);
static bool low(const _int&,const _int&);
static bool equ(const _int&,const _int&);
short *p;
size_t len;
}*p;
bool sign;
};
integer::_int::_int(const char* str):p(0),len(1)
{
char* t_str=(char*)str;
if(strlen(str)==0)
{
len=1;
p=new short[len];
p[0]=0;
return;
}
while(*t_str=='0')t_str++;
if(t_str==&str[strlen(str)]&&*(t_str-1)=='0')
{
len=1