def specific_match(versions, position=0):
    """Matches a specific position in a trie dict ordered by its keys
    Recurse on the trie until it finds an end node (i.e. a non dict node)
    Position = 0 indicates it will follow the first element
    Position = -1 indicates it will follow the last element
    """
    if not isinstance(versions, dict):
        return versions
    keys = sorted(list(versions.keys()))
    return specific_match(versions[keys[position]], position)