Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

The problem statement has recently been changed. View the changes.

×
B. Kayaking

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputVadim is really keen on travelling. Recently he heard about kayaking activity near his town and became very excited about it, so he joined a party of kayakers.

Now the party is ready to start its journey, but firstly they have to choose kayaks. There are 2·*n* people in the group (including Vadim), and they have exactly *n* - 1 tandem kayaks (each of which, obviously, can carry two people) and 2 single kayaks. *i*-th person's weight is *w*_{i}, and weight is an important matter in kayaking — if the difference between the weights of two people that sit in the same tandem kayak is too large, then it can crash. And, of course, people want to distribute their seats in kayaks in order to minimize the chances that kayaks will crash.

Formally, the instability of a single kayak is always 0, and the instability of a tandem kayak is the absolute difference between weights of the people that are in this kayak. Instability of the whole journey is the total instability of all kayaks.

Help the party to determine minimum possible total instability!

Input

The first line contains one number *n* (2 ≤ *n* ≤ 50).

The second line contains 2·*n* integer numbers *w*_{1}, *w*_{2}, ..., *w*_{2n}, where *w*_{i} is weight of person *i* (1 ≤ *w*_{i} ≤ 1000).

Output

Print minimum possible total instability.

Examples

Input

2

1 2 3 4

Output

1

Input

4

1 3 4 6 3 4 100 200

Output

5

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jan/16/2021 15:12:38 (f2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|