Party
Create a program to determine the seating arrangement of students around a round table, where each participant faces the center, and identify each participant's profession at the party.
Input
Each line of input consists of three parts, separated by spaces:
The name or profession of a party participant;
A symbol indicating their position relative to the participant named at the end of the statement:
< - interpreted as "to the left of"; > - interpreted as "to the right of"; | - interpreted as "opposite";
The name or profession of another party participant.
All lines, except the last one, end with a comma, and the last one ends with a period. All words are lowercase, except for the first letter of names. Apostrophes are not used. The number of participants, the number of letters in each word, and the number of lines do not exceed 25. The names and professions of all participants are included in the input data. All words are in the nominative case, and all names and professions are unique.
Output
Each line should present a unique seating arrangement of students around the table that aligns with the problem conditions and input data. List the names of the party participants in the order they are seated counterclockwise, as viewed from above: each subsequent participant sits to the right of the previous one. Begin the list with the name of the student that appears first in alphabetical order according to the Ukrainian alphabet: А Б В Г Ґ Д Е Є Ж З И І Ї Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Ь Ю Я. After each name, include the student's profession in parentheses, separated by a space. Separate each subsequent participant's name with a comma and a space, and end the line with a period. All words are in the nominative case.