#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n, m;
cin >> n >> m;
vector<long long> nums(n);
while (m--) {
char c;
int x, y;
cin >> c >> x >> y;
if (c == 'A') nums[x - 1] = min(10000000000LL, nums[x - 1] + y);
else nums[x - 1] = max(0LL, nums[x - 1] - y);
}
for_each(nums.begin(), nums.end(), [](long long x) {
cout << x << endl;
});
return 0;
}



京公网安备 11010502036488号