PROGRAMMING:flow shop scheduling
N jobs {1, 2,..., n} are processed on the assembly line composed of two machines M1 and M2. Each job is processed on M1 first, and then on m2. The time required for M1 and M2 processing I was a < sub > I < / sub > and B < sub > I < / sub > respectively. The flow shop scheduling problem requires * * to determine the optimal processing sequence of these n jobs, so that the time required from the first job to be processed on machine M1 and the last job to be processed on machine M2 is the least * *.
###Input format:
The first line gives the number of jobs n (0 < n < 100)
The number of each line is a < sub > I < / sub > and B < sub > I < / sub > from the second line
###Output format:
Two numbers, separated by spaces, respectively indicate the end time of M1 machine and the end time of M2 machine.
###Input example:
```in
six
30 80
120 100
50 90
20 60
90 30
110 10
```
###Output example:
```out
420 430
```
answer:If there is no answer, please comment
###Input format:
The first line gives the number of jobs n (0 < n < 100)
The number of each line is a < sub > I < / sub > and B < sub > I < / sub > from the second line
###Output format:
Two numbers, separated by spaces, respectively indicate the end time of M1 machine and the end time of M2 machine.
###Input example:
```in
six
30 80
120 100
50 90
20 60
90 30
110 10
```
###Output example:
```out
420 430
```
answer:If there is no answer, please comment