Disappointed and Disheartened Mike is really tired of jail life, and needs to take his mind off all this. Mike's roomate and good friend Kevin decidedes to help him, and tells him to try the following task:
Given a string S consisting of lowercase English alphabets of size N, can you find the lexicographically maximum substring of this string ? Mike has no knowledge what so ever of strings, and needs your help. Can you help Mike and improve his mood?
Input Format :
The first line contains a single integer N denoting the length of string S. The next line contains the string S.
Output Format :
Print the lexicographically maximum substring of String S on a single line.
Constraints :
\( 1 \le N \le 5000 \)
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial