#include <iostream> using namespace std; class FU{ public: int real; int vir; FU operator+(FU &fu1) { FU newF; newF.real = this->real + fu1.real; newF.vir = this->vir + fu1.vir; return newF; } void Print() { if(vir>=0)cout<<real<<"+"<<vir<<"i"<<endl; else cout<<real<<vir<<"i"<<endl; } }; int main() { int m; cin>>m; while(m--) { FU f1,f2; int r1,r2,v1,v2; cin>>r1>>v1>>r2>>v2; f1.real=r1; f1.vir = v1; f2.real = r2; f2.vir = v2; FU ans; ans = f1+f2; // cout<<ans.real<<"+"<<ans.vir<<"i"<<endl; ans.Print(); } } // 64 位输出请用 printf("%lld")