Shelf totals

grid is a list of rows, each row a list of quantities on one shelf. Write shelf_report(grid) that returns a dictionary with three entries: "rows", a list of each row's total; "columns", a list of each column's total; and "max_row", the index of the row with the largest total (first on ties). The grid has at least one row and all rows have the same length.

shelf_report([[1, 2], [3, 4]])  ->  {"rows": [3, 7], "columns": [4, 6], "max_row": 1}
def shelf_report(grid):
    ...