def convert_to_pairs(template):
    """
    convert template to dict of pairs
    """
    pairs = {}
    for i in range(len(template)):
        if i + 1 < len(template):
            pairs[template[i : i + 2]] = pairs.get(template[i : i + 2], 0) + 1
    return pairs