Ser has recently set up many sweet factories and is all set to give many big businessmen a run for their money. On one of his regular inspection days, he visits a factory and finds different types of sweets prepared on that day. Each sweet has a taste value . Ser asks his workers to prepare boxes of sweets, with each box containing a non-empty subset of sweets. The taste of each box is the sum of taste values of all sweets in that box.
Now, Ser asks his workers to stack up all boxes (there will be such boxes) from top to bottom in non-decreasing order of their tastes (i.e the box with maximum taste will be at the bottom). Suddenly, Ser's brother whom he fondly calls Big-B walks in and asks him how tasty is the box from the the top. Help Sir impress Big-B.
Input Format
The first line contains a number N denoting the number of different sweets.
Next line contains N space separated positive integers wherein the i'th integer represents .
Next line contains K.
Output Format
Print a single integer, the taste of the box from the top.
Constraints
Subtask 1 (10 points):
Subtask 2 (20 points): ,
Subtask 3 (70 points): Original constraints
All the sweet boxes arranged from top to bottom in non-decreasing order of their tastes are as follows:
1, 3, 4, 4, 5, 7, 8
Hence, the 4th box from the top has a taste of 4.