input: Write a function to solve the Towers of Hanoi game using recursive approach. The function should take the number of disks, source rod, spare rod, and target rod as input and print the sequence of disk movements from the source rod to the target rod. If there is only one disk, it should be directly moved from the source rod to the target rod. If there are more than one disk, the function should recursively move the top n-1 disks from the source rod to the spare rod, then move the nth disk to the target rod, and finally move the n-1 disks from the spare 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(3, [(1, "A"), (2, "A"), (3, "A")], [], []) is None
  assert hanoi(1, [(1, "A")], [], []) is None
  assert hanoi(4, [(1, "A"), (2, "A"), (3, "A"), (4, "A")], [], []) is None
  assert hanoi(2, [(1, "A"), (2, "A")], [], []) is None
  assert hanoi(0, [], [], []) 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)