open class A(a: Int, b: Int) class B(a: Int, b: Int): A(a + b, a - b)