import copy


def change_live_state(seed, new_state):
  """
  Given an input seed with live state 1, copy the seed and
  replace state 1 with new_state.
  """
  # let's not waste time by changing state 1 to state 1
  assert new_state != 1
  # copy the seed so that the original is not changed
  new_seed = copy.deepcopy(seed)
  # change state 1 in the given seed to new_state
  for x in range(new_seed.xspan):
    for y in range(new_seed.yspan):
      # update seed.cells -- state 0 remains state 0
      # and state 1 becomes new_state
      if (new_seed.cells[x][y] == 1): 
        new_seed.cells[x][y] = new_state
  #
  return new_seed