#include<bits/stdc++.h>
using namespace std;
int a[1000010];
int main()
{
int n, m;
cin >> n >> m;
for(int i = 1; i <= n; i ++) cin >> a[i];
int x, y;
for(int i = 0; i < m; i ++)
{
cin >> x >> y;
a[x] -= y;
}
bool f = 1;
for(int i = 1; i <= n; i ++)
{
if(f) f = 0;
else cout << " ";
cout << a[i];
}
puts("");
return 0;
}