#include <iostream>
using namespace std;
class complex{
    public:
        int real;
        int unreal;
        complex(int a,int b){
            real=a;
            unreal=b;
        }
        void say(){
            cout<<real<<(unreal>0?"+":"")<<unreal<<"i"<<endl;
        }
        void plus(complex x){
            this->real+=x.real;
            this->unreal+=x.unreal;
        }
};
int main() {
    int m;cin>>m;
    while(m--){
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        complex c1(a,b);
        complex c2(c,d);
        c1.plus(c2);
        c1.say();
    }
}
// 64 位输出请用 printf("%lld")