class A:
   def g(self, n):
      return n
      
   def f(self, n):
      # Take control over which method g is called.
      return A.g(self, n)
      
class B(A):
   def g(self, n):
      return 2 * n

a = A()
b = B()
print("a.f(1): {}".format(a.f(6)))
print("b.f(1): {}".format(b.f(6)))
