input: Write a function to solve the Towers of Hanoi game by recursively moving disks from one peg to another. The function should print the moves for each disk to reach the destination peg. Given a list of tuples where each tuple contains a disk number and its initial peg, the function should return nothing but print the steps to solve the puzzle.
  
  def hanoi(n, source, spare, target):
      if n == 1:
          disk = source.pop(0)
          print("Moving disk {0} from {1} to {2}".format(disk[0], disk[1], target[1]))
          target.insert(0, disk)
      else:
          hanoi(n-1, source, target, spare)
          disk = source.pop(0)
          print("Moving disk {0} from {1} to {2}".format(disk[0], disk[1], target[1]))
          target.insert(0, disk)
          hanoi(n-1, spare, source, target)
  
  assert hanoi(8, [(1, "A"), (4, "A"), (7, "A"), (2, "A"), (5, "A"), (8, "A"), (3, "A"), (6, "A")], [], []) is None
  assert hanoi(1, [(1, "A")], [], []) is None
output: def hanoi(n, source, spare, target):
      if n == 1:
          disk = source.pop(0)
          print("Moving disk {0} from {1} to {2}".format(disk[0], disk[1], target[1]))
          target.insert(0, disk)
      else:
          hanoi(n-1, source, target, spare)
          disk = source.pop(0)
          print("Moving disk {0} from {1} to {2}".format(disk[0], disk[1], target[1]))
          target.insert(0, disk)
          hanoi(n-1, spare, source, target)