input: Write a function to solve the Towers of Hanoi game. The function should take three parameters: the number of disks (n), the source rod (source), the spare rod (spare), and the target rod (target). The function should print out each move made during the solution of the game. The function should also handle the case where the number of disks is 1 by directly moving the disk from the source rod to the target rod.
  
  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(1, [(1, "A")], [(1, "B")], [(1, "C")]) == None
  assert hanoi(2, [(1, "A"), (2, "A")], [(1, "B"), (2, "B")], [(1, "C"), (2, "C")]) == None
  assert hanoi(3, [(1, "A"), (2, "A"), (3, "A")], [(1, "B"), (2, "B"), (3, "B")], [(1, "C"), (2, "C"), (3, "C")]) == 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)