a = list(input().split()) b = list(map(float, a[:4:])) if a[-1] == "+": print("{:.1f} {:.1f}".format(b[0]+b[2], b[1]+b[3])) else: print("{:.1f} {:.1f}".format(b[0]*b[2]+(-1)*b[1]*b[3], b[0]*b[3]+b[1]*b[2]))