#include <iostream>
using namespace std;
//Author: Daniel "3ICE" Berezvai

struct P{//3ICE: Pont koordinátái és azonosítója
	int x;
	int y;
	int id;
};

/** Kimenet:
+1 ha P1 -> P2 balra fordul,
 0 ha P0, P1 és P2 kollineárisak,
-1 ha P1 -> P2 jobbra fordul. */
int ForgasIrany(P P0, P P1, P P2){
	long long Kereszt = (long long)(P1.x-P0.x)*(P2.y-P0.y)-(long long)(P2.x-P0.x)*(P1.y-P0.y);
	if(Kereszt<0) return -1;
	else if(Kereszt>0) return 1;
	else return 0;
}

/** Kimenet: P1 közelebb van P0-hoz, mint P2 */
bool Kozte(P P1, P P2, P Q){
	//Feltétel: (P1, P2, Q) kollineáris
	return(abs(P1.x-Q.x)<=abs(P2.x-P1.x))&&(abs(P2.x-Q.x)<=abs(P2.x-P1.x))&&(abs(P1.y-Q.y)<=abs(P2.y-P1.y))&&(abs(P2.y-Q.y)<=abs(P2.y-P1.y));
}

/** Kimenet: akkor és csak akkor Igaz , ha a Q pont a P1-P2 szakaszon van. */
bool Szakaszon(P P1, P P2, P Q){
	return((P1.x-Q.x)*(P2.y-Q.y)-(P2.x-Q.x)*(P1.y-Q.y)==0)&&Kozte(P1,P2,Q);
}

int main(){
	P q;
	cin >> q.x >> q.y;

	int n;
	cin >> n;

	P* A = new P[n];
	for(int i = 0; i < n; i++){
		cin >> A[i].x >> A[i].y;
		A[i].id = i + 1;
		//cout<<A[i].x<<" "<<A[i].y<<" "<<A[i].id<<endl;
	}

	int opt = n / 2;//3ICE: wild guess as I only need 20 points for the best grade
	//UPDATE: Well, drat. That didn't work. Here is the algorithm instead:
	
	int* balra = new int[n];
	int* jobbra = new int[n];
	for(int i = 0; i < n; i++){
		balra[i]=0;
		jobbra[i]=0;
	}
	int irany = 0;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			irany=ForgasIrany(q, A[i], A[j]);
			//cout << A[i].id << " -> " << A[j].id << " iranya: " << irany << endl;;
			if (irany == 1){
				balra[i]++;
				//cout << "balra["<<i<<"]="<<balra[i] << endl;
			}
			else if (irany == -1){
				jobbra[i]++;
				//cout << "jobbra[" << i << "]=" << jobbra[i] << endl;
			}
			//3ICE: Harmadik eset, azaz == 0 most nem kell, mert:
			//Az egyenesre eso pontok nem számítanak.
		}
	}
	
	int max = n;
	int tmp;
	for(int i = 0; i < n; i++){
		tmp = abs(balra[i] - jobbra[i]);
		if(tmp < max){
			//cout << i << ". eset jobb: abs("<<balra[i]<<" - "<<jobbra[i]<<")=" << tmp << endl;
			max = tmp;
			opt = i;
		}
		else{
			//cout << i << ". eset nem jobb: abs(" << balra[i] << " - " << jobbra[i] << ")=" << tmp << endl;
		}
	}
	cout << opt+1 << endl;

	delete[] A;
	delete[] balra;
	delete[] jobbra;
	//cin >> n;
	return 0;
}
