





from string import ascii_uppercase







def 			_SCREAMING_SNAKE_CASE    (       a ,						a ,						a = False ,						a = ascii_uppercase  )				->				List[Any]:
					__A     :						Any          =    keyword.upper()
					__A     :						List[str]          =    plaintext.upper()
					__A     :						Optional[Any]          =    set(SCREAMING_SNAKE_CASE__  )

					# create a list of unique characters in the keyword - their order matters
					# it determines how we will map plaintext characters to the ciphertext
					__A     :						str          =    []
					for char in keyword:
										if char in alphabet_set and char not in unique_chars:
															unique_chars.append(SCREAMING_SNAKE_CASE__  )
    # the number of those unique characters will determine the number of rows
					__A     :						Optional[Any]          =    len(SCREAMING_SNAKE_CASE__  )

					# create a shifted version of the alphabet
					__A     :						List[str]          =    unique_chars + [
					    char for char in alphabet if char not in unique_chars
					]

					# create a modified alphabet by splitting the shifted alphabet into rows
					__A     :						Optional[int]          =    [
					    shifted_alphabet[k : k + num_unique_chars_in_keyword]
					    for k in range(0 ,						26 ,						SCREAMING_SNAKE_CASE__  )
					]

					# map the alphabet characters to the modified alphabet characters
					# going 'vertically' through the modified alphabet - consider columns first
					__A     :						Tuple          =    {}
					__A     :						Optional[int]          =    0
					for column in range(SCREAMING_SNAKE_CASE__  ):
										for row in modified_alphabet:
															# if current row (the last one) is too short, break out of loop
															if len(SCREAMING_SNAKE_CASE__  ) <= column:
																				break

															# map current letter to letter in modified alphabet
															__A     :						List[str]          =    row[column]
															letter_index += 1

					if verbose:
										print(SCREAMING_SNAKE_CASE__  )
					# create the encrypted text by mapping the plaintext to the modified alphabet
					return "".join(mapping[char] if char in mapping else char for char in plaintext  )


if __name__ == "__main__":
				# example use
				print(mixed_keyword('''college''', '''UNIVERSITY'''))











from __future__ import annotations







def 			_SCREAMING_SNAKE_CASE    (       a  )				->				List[str]:
					global graph, reversed_graph, scc, component, visit, stack
					if visit[u]:
										return
					__A     :						List[Any]          =    True
					for v in graph[u]:
										dfs(a  )
					stack.append(a  )







def 			_SCREAMING_SNAKE_CASE    (       a  )				->				Optional[Any]:
					global graph, reversed_graph, scc, component, visit, stack
					if visit[u]:
										return
					__A     :						str          =    True
					component.append(a  )
					for v in reversed_graph[u]:
										dfsa(a  )







def 			_SCREAMING_SNAKE_CASE    (       )				->				Optional[int]:
					global graph, reversed_graph, scc, component, visit, stack
					for i in range(a  ):
										dfs(a  )
					__A     :						str          =    [False] * n
					for i in stack[::-1]:
										if visit[i]:
															continue
										__A     :						Optional[Any]          =    []
										dfsa(a  )
										scc.append(a  )
					return scc


if __name__ == "__main__":
				# n - no of nodes, m - no of edges
				UpperCAmelCase  ,			UpperCAmelCase						:       List[str]        =					list(map(int, input().strip().split()))

				UpperCAmelCase						:       list[list[int]]        =					[[] for _ in range(n)]  # graph
				UpperCAmelCase						:       list[list[int]]        =					[[] for i in range(n)]  # reversed graph
				# input graph data (edges)
				for _ in range(m):
								UpperCAmelCase  ,			UpperCAmelCase						:       int        =					list(map(int, input().strip().split()))
								graph[u].append(v)
								reversed_graph[v].append(u)

				UpperCAmelCase						:       list[int]        =					[]
				UpperCAmelCase						:       list[bool]        =					[False] * n
				UpperCAmelCase						:       list[int]        =					[]
				UpperCAmelCase						:       list[int]        =					[]
				print(kosaraju())




