void add(Complex comp){
double nx=n+comp.n;
double mx=m+comp.m;
if(mx==0) System.out.println(nx);
if(nx==0) System.out.println(mx+"i");
if(mx<0)System.out.println(nx+"-"+(-mx)+"i");
System.out.println(nx+"+"+mx+"i");
}
void sub(Complex comp){
double nx=n-comp.n;
double mx=m-comp.m;
if(mx==0) System.out.print(nx);
if(nx==0) System.out.print("+"+mx+"i");
}
void mul(Complex comp){
double nx=n*comp.n;
double mx=m*comp.m;
if(mx==0) System.out.println(nx);
if(nx==0) System.out.println(mx+"i");
if(mx<0)System.out.println(n+"-"+(-mx)+"i");
System.out.println(nx+"+"+mx+"i");
}
void div(Complex comp){
double nx=n/comp.n;
double mx=m/comp.m;
if(mx==0) System.out.println(nx);
if(nx==0) System.out.println(mx+"i");
if(mx<0)System.out.println(nx+"-"+(-mx)+"i");
System.out.println(nx+"+"+mx+"i");
}