#include <iostream>
using namespace std;
class Complex {
private:
int a;
int b;
public:
Complex(int i = 0, int j = 0) {
a = i;
b = j;
}
Complex operator +(Complex f) {
this->a += f.a;
this->b += f.b;
return Complex(this->a, this->b);
}
void display() {
if (b < 0) cout << a << b << "i" << endl;
else cout << a << "+" << b << "i" << endl;
}
};
int main() {
int m, a, b, c, d;
cin >> m;
for (int i = 0; i < m; i++) {
cin >> a >> b >> c >> d;
Complex f1(a, b);
Complex f2(c, d);
(f1 + f2).display();
}
}



京公网安备 11010502036488号