def change_pair_coeff(input_lines, coefficient_list):
    """ Change pair coefficients of Lammps input
        Coefficient list format:
            - [[id1, id2, eps, sig], ...] """
    pair_indices = []
    for i, line in enumerate(input_lines):
        if 'pair_coeff' in line:
            pair_indices.append(i)
    pair_lines = []
    for coefficient in coefficient_list:
        id1, id2, eps, sig = coefficient
        pair_lines.append('pair_coeff      %i %i %.3f %.3f\n' % (id1, id2, eps, sig))

    new_lines = input_lines[:pair_indices[0]] + pair_lines + input_lines[pair_indices[-1] + 1:]
    return new_lines