def convert_token(token: str) -> tuple[int, int]:
    """Converts string token into 2d grid offset

    :param token: token in string format
    :return: 2d grid offset in integer format
    """
    direction, length = token[:1], int(token[1:])
    assert direction in ['R', 'L', 'U', 'D']
    if direction in ['L', 'D']:
        length *= -1
    offset = (length, 0) if direction in ['R', 'L'] else (0, length)
    return offset