def split_by_two_strings(line, str1, str2):
    """Split the input line into three parts separated by two given strings."""
    # Start of second part in the input string.
    i1 = line.index(str1) + len(str1)

    # End of second part in the input string.
    i2 = line.index(str2)

    # Now we know where the second part can be found in input string. It is
    # therefore easy to figure out where the first part and third part are.
    return line[:i1], line[i1:i2], line[i2:]