def hit(row, column, fleet):
    """
    This method returns a tuple (fleet, ship) where ship is the ship from the fleet that receives a hit
    by the shot at the square represented by row and column, and fleet is the fleet resulting from this hit.
    :param row: int
    :param column: int
    :param fleet: list
    :returns fleet, ship: tuple
    """
    for i in range(len(fleet)):
        for j in range(fleet[i][3]):
            # if horizontal
            if fleet[i][2]:
                if row == fleet[i][0] and column == fleet[i][1] + j:
                    fleet[i][4].add((row, column))
                    return fleet, fleet[i]
            # if vertical
            else:
                if row == fleet[i][0] + j and column == fleet[i][1]:
                    fleet[i][4].add((row, column))
                    return fleet, fleet[i]