#!/usr/bin/env python3 class Rational: def __init__(self, numerator, denominator): self.whole = numerator // denominator self.numerator = numerator % denominator self.denominator = denominator def __gt__(self, other): return self.whole > other.whole or (self.whole == other.whole and self.numerator * other.denominator > other.numerator * self.denominator) class Vec: def __init__(self, x, y): self.x = int(x) self.y = int(y) def __add__(self, other): return Vec(self.x + other.x, self.y + other.y) def __sub__(self, other): return Vec(self.x - other.x, self.y - other.y) def __mul__(self, other): return self.x * other.x + self.y * other.y N = int(input()) points = [Vec(*input().split()) for _ in range(N)] best = 0 peak = 1 bestHeight = Rational(0, 1) for i in range(N): p1 = points[i] p2 = points[(i + 1) % N] norm = Vec(p1.y - p2.y, p2.x - p1.x) distance = abs((points[peak] - p1) * norm) while (nextDistance := abs((points[(nextP := (peak + 1) % N)] - p1) * norm)) >= distance: peak = nextP distance = nextDistance height = Rational(distance * distance, norm * norm) if height > bestHeight: best = i bestHeight = height print(best + 1)