The first line contains two integers N and M (2≤N≤50000, 1≤M≤250000), the number of players and the number of reported matches.
Each of the next M lines contains an integer K, a symbol that is either = or >, and an integer L (0≤K,L<N). The integers K and L identify players. If the symbol is =, the game between K and L was a draw. If the symbol is >, then K beat L.
At most one match is reported between any given pair of players. Every player takes part in at least one reported match.