def match_2d(puzzle, row, col, word):
    """
    Match word in current position in 4 directions
    :param puzzle:
    :param row:
    :param col:
    :param word:
    :return: Tuple x, y end coordinates or None
    """

    # Directions - left, down, right, up and 4 directions diagonally
    dirs = [(1, 0), (0, 1), (-1, 0), (0, -1), (1, 1), (1, -1), (-1, 1), (-1, -1)]

    word = bytearray(word)

    # Check starting point first
    if puzzle[row][col] != word[0]:
        return None

    # Dimensions
    dim = len(puzzle)

    # Search in multiple directions
    for x, y in dirs:
        ri = row
        ci = col
        for ch in word[1:]:
            ri += x
            ci += y
            if ri < 0 or ri == dim or ci < 0 or ci == dim:
                break
            if ch != puzzle[ri][ci]:
                break
        else:
            return ri, ci
    return None