Joust Sort We are going to organise the letters of the word using a novel algorithm based on the natural instincts of the hoarse chestnut tree: a grand tournament between its constituent letters. We will pick several pairs of letters and have them face off. The result of a match between these letters determines their relative order. For example, if , then all occurrences of in a well-organised word should come before all occurrences of in that word. If there is no case for or , then the individual letters and may intersperse among each other in any order. Given a word, and several such matches, determine a fair rearrangement of the word to meet all of the constraints given. It is possible that multiple such rearrangements exists, or that none exist at all. Input itemize One line containing the number of orders to follow, (). further lines, each containing a distinct ordering of two lowercase letters and separated by a < or > character and spaces. One final line containing the word to improve, (. itemize Output Output a sorted version of the word, or IMPOSSIBLE if the word cannot be sorted according to all of the rules at once. In case there are multiple answers, you may output any one of them.