class cplx{
    double re, im;
public:
    cplx(double _re=0, double _im=0):re(_re), im(_im){}
    cplx operator+(cplx b) const
    {
        return cplx(re+b.re, im+b.im);
    }
    cplx operator+(double x) const
    {
        return cplx(x+re, im);
    }
};
inline cplx operator+(double x, cplx b)
{
    return b+x;
}
