import string


def clean_input(line):
  """Clean up a line of input so it only contains 'A'--'Z'."""

  line = line.strip()
  output = []
  for char in line:
    char = char.upper()
    if char in string.ascii_uppercase:
      output.append(char)

  return ''.join(output)