input: Write a function to solve the Towers of Hanoi game using a recursive approach. The function should take in three lists representing the source peg, the spare peg, and the target peg, as well as an integer n representing the number of disks. The function should move the disks from the source peg to the target peg following the rules of the Towers of Hanoi game and print the moves. If the input is empty, the function should return without making any moves.
  
  
  def hanoi(n, source, spare, target):
      if n == 0:
          return
      hanoi(n-1, source, target, spare)
      disk = source.pop(0)
      print("Moving disk {0} from {1} to {2}".format(disk, source[0][1], target[0][1]))
      target.insert(0, disk)
      hanoi(n-1, spare, source, target)
  
  assert hanoi(3, [(1, "A"), (2, "A"), (3, "A")], [], []) == None
  assert hanoi(0, [], [], []) == None
  assert hanoi(1, [(1, "A")], [], []) == None
  assert hanoi(2, [(1, "A"), (2, "A")], [], []) == None
  assert hanoi(4, [(1, "A"), (2, "A"), (3, "A"), (4, "A")], [], []) == None
  
output: def hanoi(n, source, spare, target):
      if n == 0:
          return
      hanoi(n-1, source, target, spare)
      disk = source.pop(0)
      print("Moving disk {0} from {1} to {2}".format(disk[0], source[0][1], target[0][1]))
      target.insert(0, disk)
      hanoi(n-1, spare, source, target)