input: Write a function to solve the Towers of Hanoi game recursively. The function should take the number of disks, source peg, spare peg, and target peg as input, and print the moves required to solve the problem.
  
  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(4, ['A', 'A', 'A', 'A'], ['B', 'B', 'B', 'B'], ['C', 'C', 'C', 'C'])  # Expected output: Moves printed for solving the Towers of Hanoi with 4 disks
  assert hanoi(3, ['A', 'A', 'A'], ['B', 'B', 'B'], ['C', 'C', 'C'])  # Expected output: Moves printed for solving the Towers of Hanoi with 3 disks
  assert hanoi(2, ['A', 'A'], ['B', 'B'], ['C', 'C'])  # Expected output: Moves printed for solving the Towers of Hanoi with 2 disks
  assert hanoi(1, ['A'], ['B'], ['C'])  # Expected output: Moves printed for solving the Towers of Hanoi with 1 disk
  assert hanoi(0, [], [], [])  # Expected output: No moves printed since there are no disks
output: def hanoi(n, source, spare, target):
      if n == 1:
          print("Moving disk from {} to {}".format(source, target))
      else:
          hanoi(n-1, source, target, spare)
          print("Moving disk from {} to {}".format(source, target))
          hanoi(n-1, spare, source, target)