```python
from typing import Dict

def end_grab(cards: list) -> Dict[str, int]:
    """
    Calculate the totals and taken numbers for the end-grab game.

    :param cards: List of integers representing the cards in the row.
    :return: A dictionary with keys 'first', 'second', 'taken' and their respective values.
    """
    if not cards:
        raise ValueError("The row cannot be empty.")

    totals = {'first': 0, 'second': 0}
    taken = []

    while cards:
        if len(cards) == 1:
            totals['first'] += cards[0]
            taken.append(cards[0])
            break

        if cards[0] > cards[-1]:
            totals['first'] += cards.pop(0)
            taken.append(cards[0])
        elif cards[0] < cards[-1]:
            totals['second'] += cards.pop(-1)
            taken.append(cards[-1])
        else:
            totals['first'] += cards.pop(0)
            totals['second'] += cards.pop(-1)
            taken.append(cards[0])
            taken.append(cards[-1])

    return {
        'first': totals['first'],
        'second': totals['second'],
        'taken': taken
    }
```