def A(x):
    return x*x - 2*x + 1

def B(x):
    return (x - 1)**2