A. Deck Building
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Cookie Sigma is ready to play some Clash Royale! Before he can battle for trophies, he must build his deck.

He is given two arrays of size $$$n$$$ $$$(4 \leq n \leq 100)$$$, $$$a$$$ and $$$b$$$. Each index $$$i$$$ $$$(1 \leq i \leq n)$$$ represents a pair of cards with elixir costs $$$a_i$$$ and $$$b_i$$$.

To build his deck, Cookie Sigma must follow these rules:

  • He cannot add individual cards—he must choose an index $$$i$$$ and add both cards $$$a_i$$$ and $$$b_i$$$ to his deck.
  • He cannot choose the same index more than once.
  • A Clash Royale deck must contain exactly $$$8$$$ cards, so he must select 4 distinct indices in total.

Cookie Sigma loves cycle decks and wants to minimize the total elixir cost of his deck. Help him determine the minimum possible total elixir cost of any valid deck he can create!

Input

The first line contains an integer $$$n$$$ $$$(4 \leq n \leq 100)$$$, the size of $$$a$$$ and $$$b$$$.

The second line contains $$$n$$$ integers, $$$[a_1, a_2, ... a_n]$$$ $$$(1 \leq a_i \leq 1000$$$), the elements in $$$a$$$.

The third line contains $$$n$$$ integers, $$$[b_1, b_2, ... b_n]$$$ $$$(1 \leq b_i \leq 1000$$$), the elements in $$$b$$$.

Output

Output one number, the minimum possible total elixir cost of a valid deck Cookie Sigma can create. Note that this is the total cost of his deck (the sum of elixir of all cards in his deck), NOT the average elixir cost.

Example
Input
6
4 3 9 2 9 2
1 3 8 3 1 5
Output
23
Note

In the example test case, it is optimal for Cookie Sigma to pick indices $$$1, 2, 4, 6$$$ and add the cards at these indices to his deck. By doing this, his deck will consist of cards with elixir costs $$$[1, 2, 2, 3, 3, 3, 4, 5]$$$. Summing these up, we can see that the total elixir cost of his deck is 23 elixir.