#include <bits/stdc++.h>
using namespace std;
signed main()
{
int n,m;
cin>>n>>m;
int i = 0 , j = 0;
while(n--)//所有操作的结果直接弄成一个数
{
int x,y;
cin>>x>>y;
i = i + x;
j = j + y;
}
while(m--)
{
int x,y;
cin>>x>>y;
x = x + i;
y = y + j;
cout<<x<<" "<<y<<endl;
}
return 0;
}