Back
Close

The greatest element

Statement

 Goal

You're given several relations, either < or >. Output the greatest element. If there exists more than one possible output, sort it alphabetically.
Input
Line: Number N of relations
Line: Relation 1
...
Line: Relation N
Output
Line 1: Space separated list of elements.
Constraints
Elements are limited to A-Z.
Example
Input
2
A>B
A>C
Output
A

Game modes
Fastest, Shortest, Reverse

Test cases
Test 1 Test
Input
2 A>B A>C
Output
A

Validator 1 Validator
Input
2 A>B A>D
Output
A

Test 2 Test
Input
3 A>B C>B A>C
Output
A

Validator 2 Validator
Input
3 A>B C>B A>D
Output
A C

Test 3 Test
Input
5 A>B A>C E<C F>C F<B
Output
A

Validator 3 Validator
Input
5 A>B A>C E<D F>D F>A
Output
F

Test 4 Test
Input
5 E<C F<C F<B Z>J J<B
Output
B C Z

Validator 4 Validator
Input
5 E>A F<A I>Q W<Y L>E
Output
I L Y

Solution language

Solution

Stub generator input