input: Write a python function to modify a given solution by appending specific lines of code and returning the modified solution.
  assert modify_solution("def example():\n    pass\n", ["item_list", "new_item"]) == "def example():\n    pass\n    item_index = item_list.index(new_item)\n    return item_index"
  assert modify_solution("def foo(bar):\n    print(bar)\n", ["item_list", "new_item"]) == "def foo(bar):\n    print(bar)\n    item_index = item_list.index(new_item)\n    return item_index"
  assert modify_solution("def add(a, b):\n    return a + b\n", ["item_list", "new_item"]) == "def add(a, b):\n    return a + b\n    item_index = item_list.index(new_item)\n    return item_index"
output: def modify_solution(solution, variables):
      lines = solution.rstrip().split('\n')
      lines.append(f"    item_index = {variables[0]}.index({variables[1]})")
      lines.append("    return item_index")
      return '\n'.join(lines)