#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve() {
int n, m; cin >> n >> m;
vector<int> r(n+1), c(n+1), ansR(n+1), ansC(n+1), tot(n+1, 0);
for (int i = 1; i <= n; i++) {
cin >> r[i] >> c[i];
ansR[i] = r[i];
ansC[i] = c[i];
}
for (int i = 1; i <= m; i++) {
int x; cin >> x;
tot[x]++;
}
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
if (i == j) continue;
int diffR = abs(r[i] - r[j]);
int diffC = abs(c[i] - c[j]);
if (diffR == diffC) {
if (r[j] > r[i]) ansR[j]+=tot[i];
else ansR[j]-=tot[i];
if (c[j] > c[i]) ansC[j]+=tot[i];
else ansC[j]-=tot[i];
}
else if (diffR < diffC) {
if (c[j] > c[i]) ansC[j]+=2*tot[i];
else ansC[j]-=2*tot[i];
}
else if (diffC < diffR) {
if (r[j] > r[i]) ansR[j]+=2*tot[i];
else ansR[j]-=2*tot[i];
}
}
}
for (int i = 1; i <= n; i++) {
cout << ansR[i] << " " << ansC[i] << "\n";
}
}
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int t = 1;
while (t--) solve();
return 0;
}