#include <iostream>
#include <math.h>
using namespace std;
class Cmycomplex{
private:
double x,y;
public:
Cmycomplex(double a,double b){
x=a;y=b;
}
Cmycomplex(double a){
x=a;y=0;
}
Cmycomplex(){
x=0;y=0;
}
Cmycomplex operator+ (Cmycomplex &z){
Cmycomplex t;
t.x=x+z.x;
t.y=y+z.y;
return t;
}
Cmycomplex operator+(double n) {
Cmycomplex t;
t.x = x + n;
t.y = y;
return t;
}
friend Cmycomplex operator+(double n, Cmycomplex &z) {
Cmycomplex t;
t.x = n+z.x;
t.y = z.y;
return t;
}
void Set(double a,double b){
x=a;y=b;
}
Cmycomplex operator- (Cmycomplex &z){
Cmycomplex t;
t.x=x-z.x;
t.y=y-z.y;
return t;
}
void Show(){
if(y<0){
cout<<"("<<x<<y<<"i"<<")";
}
else
cout<<"("<<x<<"+"<<y<<"i"<<")";
}
};
//StudybarCommentBegin
int main()
{
Cmycomplex z1(3,4),z2(7),z3,z4(z1);
double x,y;
cin>>x>>y;
z3.Set(x,y);
cout<<endl;
z3=z3+z2;
z3.Show();
z4=2+z4;
cout<<endl;
z4.Show();
z4=z4+2;
cout<<endl;
z4.Show();
}
//StudybarCommentEnd