You are waiting in line to obtain ski rentals at Hack the North 2017. To get your ski, you must wait in one of three lines. Each line will have , , and skiers respectively. Additionally, each skier will have a wait time attached to them, where represents the number of seconds it takes for them to choose a rental.

At the end of every seconds, the last skier from the longest line (not longest wait time) will move to a line with a fewer amount of people if that line consists of fewer people than the one they are currently waiting in. If there are ties for the shortest or longest lines, nobody will move. The skiers who move will switch regardless of the new wait time in front of them.

How long will it take for all skiers to get their rentals?

#### Input Specification

The first line of input consists of three integers separated by spaces: , , and ().

The second line of input will have the wait times for the skiers in the line, in order from front to end of the line.

The third line of input will have the wait times for the skiers in the line, in order from front to end of the line.

The fourth line of input will have the wait times for the skiers in the line, in order from front to end of the line.

It is guaranteed that .

- For 4 of the 15 available marks, and .
- For an additional 4 of the 15 available marks, and .
- For an additional 4 of the 15 available marks, .

#### Output Specification

The output will contain a single integer, the number of seconds it takes for all skiers to get their rentals.

#### Sample Input 1

```
2 1 3
30 20
30
30 10 20
```

#### Sample Output 1

`50`

#### Sample Input 2

```
3 2 3
20 5 4
15 9
8 9 5
```

#### Sample Output 2

`29`

## Comments

Batch 3 case 5 may not satisfy input specification.

Thank you, Jason!

If there isn't a tie for the shortest or longest line, does the skier at the back of the longest line move to the back of the shortest line or the back of the second-shortest line, or the back any of those two lines?

The skier will move to the back of the shortest line (the one with the least amount of people).