def pos(directions):
    """
    Given a set of directions, figure out the actual index on the (x,y) coordinate grid.
    """
    x, y = 0, 0
    for dx, dy in directions:
        x, y = x + dx, y + dy
    return x, y