class P:
def __init__(self, x, y):
self.x = x
self.y = y
def __add__(a, b):
return P(a.x + b.x, a.y + b.y)
def __sub__(a, b):
return P(a.x - b.x, a.y - b.y)
def __mul__(a, b):
return P(a.x * b, a.y * b)
def dot(a, b):
return (a.x * b.x) + (a.y * b.y)
def cross(a, b):
return (a.x * b.y) - (a.y * b.x)