#include using namespace std; struct query { char c; int64_t x, y; }; int main() { int n, q; cin >> n >> q; vector a(n); for (int i = 0; i < n; i++) cin >> a.at(i); vector v(q); for (int i = 0; i < q; i++) cin >> v.at(i).c >> v.at(i).x >> v.at(i).y; reverse(v.begin(), v.end()); vector b(n), count(n); for (auto t : v) { if (t.c == 'A') { b.at(t.x - 1) += count.at(t.x - 1) * t.y; } else { for (int i = t.x - 1; i < t.y; i++) { count.at(i)++; } } } for (int i = 0; i < n; i++) { b.at(i) += count.at(i) * a.at(i); } for (int i = 0; i < n; i++) { cout << b.at(i); if (i < n - 1) { cout << " "; } else { cout << endl; } } }