import java.util.*;
public class Main {
public static void main
(String args
[]) { Scanner sc
= new Scanner
(System.
in); while (sc.hasNextLine()) {
String s
[] = sc.
nextLine().
replace("i",
"").
split(" "); int x1 = 1, x2 = 1;
if (s[0].charAt(0) == '-') {
s[0] = s[0].substring(1, s[0].length());
x1 *= -1;
}
if (s[0].indexOf("+") != -1) {
x1
*= Integer.
parseInt(s
[0].
split("\\+")[0]); x2
*= Integer.
parseInt(s
[0].
split("\\+")[1]); } else {
x1
*= Integer.
parseInt(s
[0].
split("-")[0]); x2
*= Integer.
parseInt(s
[0].
split("-")[1]) * (-1); }
int y1 = 1, y2 = 1;
if (s[2].charAt(0) == '-') {
s[2] = s[2].substring(1, s[2].length());
y1 *= -1;
}
if (s[2].indexOf('+') != -1) {
y1
*= Integer.
parseInt(s
[2].
split("\\+")[0]); y2
*= Integer.
parseInt(s
[2].
split("\\+")[1]); } else {
y1
*= Integer.
parseInt(s
[2].
split("-")[0]); y2
*= Integer.
parseInt(s
[2].
split("-")[1]) * (-1); }
if (s[1].equals("+")) {
x1 = x1 + y1;
x2 = x2 + y2;
} else {
x1 = x1 - y1;
x2 = x2 - y2;
}
String c
= (x2
>= 0 ? "+" : ""); System.
out.
printf("%d%s%di\n", x1, c, x2
); }
}
}
aW1wb3J0IGphdmEudXRpbC4qOwoKcHVibGljIGNsYXNzIE1haW4gewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nIGFyZ3NbXSkgewogICAgICAgIFNjYW5uZXIgc2MgPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwogICAgICAgIHdoaWxlIChzYy5oYXNOZXh0TGluZSgpKSB7CiAgICAgICAgICAgIFN0cmluZyBzW10gPSBzYy5uZXh0TGluZSgpLnJlcGxhY2UoImkiLCAiIikuc3BsaXQoIiAiKTsKICAgICAgICAgICAgaW50IHgxID0gMSwgeDIgPSAxOwogICAgICAgICAgICBpZiAoc1swXS5jaGFyQXQoMCkgPT0gJy0nKSB7CiAgICAgICAgICAgICAgICBzWzBdID0gc1swXS5zdWJzdHJpbmcoMSwgc1swXS5sZW5ndGgoKSk7CiAgICAgICAgICAgICAgICB4MSAqPSAtMTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoc1swXS5pbmRleE9mKCIrIikgIT0gLTEpIHsKICAgICAgICAgICAgICAgIHgxICo9IEludGVnZXIucGFyc2VJbnQoc1swXS5zcGxpdCgiXFwrIilbMF0pOwogICAgICAgICAgICAgICAgeDIgKj0gSW50ZWdlci5wYXJzZUludChzWzBdLnNwbGl0KCJcXCsiKVsxXSk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICB4MSAqPSBJbnRlZ2VyLnBhcnNlSW50KHNbMF0uc3BsaXQoIi0iKVswXSk7CiAgICAgICAgICAgICAgICB4MiAqPSBJbnRlZ2VyLnBhcnNlSW50KHNbMF0uc3BsaXQoIi0iKVsxXSkgKiAoLTEpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGludCB5MSA9IDEsIHkyID0gMTsKICAgICAgICAgICAgaWYgKHNbMl0uY2hhckF0KDApID09ICctJykgewogICAgICAgICAgICAgICAgc1syXSA9IHNbMl0uc3Vic3RyaW5nKDEsIHNbMl0ubGVuZ3RoKCkpOwogICAgICAgICAgICAgICAgeTEgKj0gLTE7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKHNbMl0uaW5kZXhPZignKycpICE9IC0xKSB7CiAgICAgICAgICAgICAgICB5MSAqPSBJbnRlZ2VyLnBhcnNlSW50KHNbMl0uc3BsaXQoIlxcKyIpWzBdKTsKICAgICAgICAgICAgICAgIHkyICo9IEludGVnZXIucGFyc2VJbnQoc1syXS5zcGxpdCgiXFwrIilbMV0pOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgeTEgKj0gSW50ZWdlci5wYXJzZUludChzWzJdLnNwbGl0KCItIilbMF0pOwogICAgICAgICAgICAgICAgeTIgKj0gSW50ZWdlci5wYXJzZUludChzWzJdLnNwbGl0KCItIilbMV0pICogKC0xKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoc1sxXS5lcXVhbHMoIisiKSkgewogICAgICAgICAgICAgICAgeDEgPSB4MSArIHkxOwogICAgICAgICAgICAgICAgeDIgPSB4MiArIHkyOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgeDEgPSB4MSAtIHkxOwogICAgICAgICAgICAgICAgeDIgPSB4MiAtIHkyOwogICAgICAgICAgICB9CiAgICAgICAgICAgIFN0cmluZyBjID0gKHgyID49IDAgPyAiKyIgOiAiIik7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRmKCIlZCVzJWRpXG4iLCB4MSwgYywgeDIpOwogICAgICAgIH0KICAgIH0KfQ==