input: Write a function to solve the Towers of Hanoi game. The function should take the number of disks `n`, and three lists `source`, `spare`, and `target` representing the three pegs. It should print the moves required to solve the game and update the lists accordingly.
  
  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, [(i, "A") for i in range(1, 9)], [], [])
  assert hanoi(3, [(i, "A") for i in range(1, 4)], [], [])
  assert hanoi(0, [], [], [])
  assert hanoi(5, [(i, "A") for i in range(1, 6)], [], [])
  assert hanoi(1, [(1, "A")], [], [])
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)