input: def hanoi(n: int, source: List[Tuple[int, str]], spare: List[Tuple[int, str]], target: List[Tuple[int, str]]) -> None:
      """ Solves the Towers of Hanoi game for n disks. Moves all disks from the source
      rod to the target rod according to the rules of the game. Each disk is represented
      by a tuple (disk_number, rod_name).
      >>> source = [(1, "A"), (4, "A"), (7, "A"), (2, "A"), (5, "A"), (8, "A"), (3, "A"), (6, "A")]
      >>> target = []
      >>> spare = []
      
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 7 from A to C
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 2 from A to B
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 7 from C to B
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 5 from A to C
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 2 from B to A
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 7 from B to C
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from A to C
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 3 from A to B
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 7 from C to B
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from C to A
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 3 from B to A
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 5 from C to B
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from A to C
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 3 from A to B
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 8 from C to B
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from C to A
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 3 from B to A
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 5 from B to C
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from A to C
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 3 from A to B
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 7 from B to C
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from C to A
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 3 from B to A
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 6 from B to C
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from A to C
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 3 from A to B
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 5 from B to C
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from C to A
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 3 from B to A
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 7 from B to C
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from A to C
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 3 from A to B
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 8 from B to C
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from C to A
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 3 from B to A
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 5 from B to C
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from A to C
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 3 from A to B
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 7 from B to C
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from C to A
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 3 from B to A
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 6 from B to C
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from A to C
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 3 from A to B
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 5 from B to C
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from C to A
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 3 from B to A
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 7 from B to C
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from A to C
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 3 from A to B
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 8 from B to C
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from C to A
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk 3 from B to A
      Moving disk 1 from C to B
      Moving disk 4 from C to A
      Moving disk 1 from B to A
      Moving disk 5 from B to C
      Moving disk 1 from A to C
      Moving disk 4 from A to B
      Moving disk 1 from C to B
      Moving disk 2 from A to C
      Moving disk 1 from B to A
      Moving disk 4 from B to C
      Moving disk 1 from A to C
      Moving disk2 from A to B
      Moving disk1 from C to B
      Moving disk 3 from C to A
      Moving disk1 from B to A
      Moving disk 2 from B to C
      Moving disk 1 from A to C
      """
output:     if n == 1:
          disk = source.pop()
          target.append(disk)
          print(f"Moving disk {disk[0]} from {disk[1]} to {target[-1][1]}")
      else:
          hanoi(n - 1, source, target, spare)
          disk = source.pop()
          target.append(disk)
          print(f"Moving disk {disk[0]} from {disk[1]} to {target[-1][1]}")
          hanoi(n - 1, spare, source, target)