/* Author haleyk10198 */
/* 作者: haleyk10198 */
#include <iostream>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <map>
#include <queue>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <ctime>
#include <string>
#include <set>
#define MOD 1000000007
#define INF 2147483647
#define PI 3.1415926535897932384626433
#define ll long long
#define pii pair<int,int>
#define mp(x,y) make_pair((x),(y))
using namespace std;
pii pos[10];
pii mon[1010];
pii now;
int nowa;
vector<vector<int> > srt;
bool hit[1010];
vector<pii> delay;
double angle(pii a,pii b){
if(a.first==b.first){
if(a.second>b.second)
return -90.0;
else
return 90.0;
}
if(a.first>b.first)
return tan(1.0*(b.second-a.second)/(b.first-a.first));
else
return PI+tan(1.0*(b.second-a.second)/(b.first-a.first));
}
ll dist(pii a,pii b){
return abs(1LL*a.first-b.first)+abs(1LL*a.second-b.second);
}
struct Custom{
bool operator()(int a,int b){
pii mona=mon[srt[nowa][a]],monb=mon[srt[nowa][b]];
return (angle(now,mona)<angle(now,monb))||(angle(now,mona)==angle(now,monb)&&dist(now,mona)<dist(now,monb));
}
};
int main(){
int n,k;
cin>>k>>n;
for(int i=0;i<k;i++)
cin>>pos[i].first>>pos[i].second;
for(int i=0;i<n;i++)
cin>>mon[i].first>>mon[i].second;
vector<int> dummy;
for(int i=0;i<n;i++)
dummy.push_back(i);
for(int i=0;i<k;i++){
srt.push_back(dummy);
now=pos[i];
nowa=i;
sort(srt[i].begin(),srt[i].end(),Custom());
}
for(int round=0;round<k;round++){
for(int i=0;i<k;i++){
delay.clear();
for(auto x:srt[i])
cout<<angle(pos[i],mon[x])<<" "<<dist(pos[i],mon[x])<<endl;
for(int j=0;j<srt[i].size();j++){
if(j==0||angle(pos[i],mon[srt[i][j]])!=angle(pos[i],mon[srt[i][j-1]])){
hit[srt[i][j]]=true;
delay.push_back(mp(i,srt[i][j]));
}
}
}
for(auto x:delay){
for(int i=0;i<k;i++){
if(i-x.first){
for(vector<int>::i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