Number operator * (const int x, const Number& y) { return Number(x * y.GetNum(), y.GetMod()); }
Number operator * (const Number& x, const int y) { return Number(x.GetNum() * y, x.GetMod()); }
Number operator + (const Number& x, const Number& y) { return Number(x.GetNum() + y.GetNum(), x.GetMod()); }
bool operator != (const Number& x) { return (mod != x.GetMod() || num != x.GetNum()); }
bool operator == (const Number& x) { return (mod == x.GetMod() && num == x.GetNum()); }
Number operator = (const Number x) { mod = x.GetMod(); num = x.GetNum() % mod; return *this; }