def stencil(data, f, width):
    """
    perform a stencil using the filter f with width w on list data
    output the resulting list
    note that if len(data) = k, len(output) = k - width + 1
    f will accept as input a list of size width and return a single number
    :param data: list
    :param f: function
    :param width: int
    :return: list
    """
    # Fill in\\
    k = len(data)
    r = data.copy()
    new = []
    t =[]
    for i in range(0,k - width):
        z = 0
        while z < width <= len(data):
            t.append(r[z])
            z += 1
        x = f(t)
        del(r[0])
        t = []
        new.append(x)
    return new
    pass