input: Write a python function to merge two dictionaries and sum the values of common keys.
  assert merge_dicts({'a': 10, 'b': 20, 'c': 30}, {'a': 15, 'd': 40}) == {'a': 25, 'b': 20, 'c': 30, 'd': 40}
  assert merge_dicts({'x': 5, 'y': 10}, {'y': 15, 'z': 20}) == {'x': 5, 'y': 25, 'z': 20}
  assert merge_dicts({'m': 1, 'n': 2}, {'n': 3, 'o': 4}) == {'m': 1, 'n': 5, 'o': 4}
output: def merge_dicts(dict1, dict2):
      result = dict1.copy()
      for key, value in dict2.items():
          if key in result:
              result[key] += value
          else:
              result[key] = value
      return result