# 202. Mixed Fractions

## I'm a slow walker, but I never walk backwards.

Write a program to calculate addition, subtraction, multiplication, and division for two mixed fractions. You will be given two mixed fractions -- $a \dfrac{b}{c}$ and $e \dfrac{f}{g}$. For example, if $a = 1$, $b = 3$, and $c = 4$, then you have 1.75. You can also represent negative number by a negative $a$, so if $a = -1$, $b = 3$, and $c = 4$, then the result is -1.75. For simplicity we assume that $a$ and $e$ are always non-zero, $b$ and $f$ are always non-negative, and $c$ and $g$ are always positive. Also, $b$ and $c$ have to be simplified. For example, you cannot have $a = 1$, $b = 6$, and $c = 8$. Also when $b$ or $f$ is 0, $c$ and $g$ must be 1. We will be given an extra number $d$ as the operator. If $d$ is 0, 1, 2, 3, then the operation is addition, subtraction, multiplication, and division, respectively. Now given $a, b, c, d, e, f, g$, compute the final result as a mixed fraction $h \dfrac{i}{j}$.

## Limits

The ranges of numbers are as follow. $a$ and $e$ are non-zero and between -100 and 100 inclusively. $b$, and $f$ are non-negative and no more than 100. $c$ and $g$ are positive and no more than 100. $d$ is always between 0 and 3 inclusively.

## Input

$a, b, c, d, e, f, g$

## Output

The output follows the same rules as the input. You should output $h$, $i$, and $j$ in three lines.

## Sample input

1340-234

## Sample output

-101

## Sample input

2012-113

## Sample output

-223