In our custom compiler design for each Keyword in C we assign a particular value defined by us. Ex: Keyword " int " may have value 56, "for" may have value 100 etc. The project in-charge is curious to know what is the maximum possible value that can be generated by the combination of Keywords(taken entirely or partially in proportion with their values) which is known as the new Super Keyword. But due to certain limitations the length of this Super Keyword cannot exceed by a certain value. Unfortunately our team is busy with designing the front end of the compiler so we need your help to calculate this max value generated by the "Super Keyword". Also we have to specify what is this Super Keyword generated by us. It's the professor's demand that out of all combinations our superkeyword must have the highest sum of ASCII values of it's letters and they should be in descending order (lexicographically).
Input Format:
The first line contains N the number of keywords.
Each of the next N lines contain a keyword of length L followed by its value V.
The N+1 th line contains the maximum permitted length of the Super Keyword.
Output Format:
Print one line containing the super keyword genarted and maximum possible value rounded to the nearest integer. (example: 12.5 should be rounded to 13)
Constraints:
1<= N<= 100
1<=V <=10000
1<=L<=100
As seen in the above testcase to maximize the value we take "for","while" and partially "continue" as only "ut" (we take "continue" keyowrd partially as the length should not exceed by 10) also notice we hae taken "ut" to maimize the sum of ASCII values of its letters. Our final result is "wutrolihfe" whose value comes out to be 52.5 which is rounded to 53.