#include <math.h>

class Complex {
    double re, im;
public:
    Complex(double a_re = 0, double a_im = 0);
    double Magnitude() const { return sqrt(re*re + im*im); }
    double Argument() const { return atan2(im, re); }
    double GetRe() const { return re; }
    double GetIm() const { return im; }
    Complex operator+(const Complex &op2) const;
    Complex operator-(const Complex &op2) const;
    Complex operator*(const Complex &op2) const;
    Complex operator/(const Complex &op2) const;
    void Print() const;
};

inline Complex Complex::operator+(const Complex &op2) const
{
    return Complex(re + op2.re, im + op2.im);
}

inline Complex Complex::operator-(const Complex &op2) const
{
    return Complex(re - op2.re, im - op2.im);
}

inline Complex Complex::operator*(const Complex &op2) const
{
    return Complex(re * op2.re - im * op2.im,
                   re * op2.im + im * op2.re);
}

inline Complex Complex::operator/(const Complex &op2) const
{
    double dvs = op2.re * op2.re + op2.im+op2.im;
    return Complex((re * op2.re + im * op2.im) / dvs,
                   (re * op2.im + im * op2.re) / dvs);
}
