#include using namespace std; #define fi first #define se second #define pb push_back using vi = vector ; using ll = long long; using vl = vector ; using pii = pair ; const ll mod = 998244353; //~ const ll mod = 1e9 + 7; ll qpow(ll a, ll b, ll m = mod) { ll r = 1, t = a; for(; b; b /= 2) { if(b & 1) r = r * t % m; t = t * t % m; } return r; } const int N = 2e5 + 11; const int B = 500; ll a[N]; ll diff[N], cnt[N], b[N]; int main() { ios::sync_with_stdio(0); int n, q; cin >> n >> q; for(int i = 1; i <= n; i ++) { cin >> a[i]; } vector add; for(int t = 1; t <= q; t ++) { char c; int x, y; cin >> c >> x >> y; if(c == 'A') { add.pb({x, y}); } else { for(auto [i, j] : add) if(i >= x && i <= y) { b[i] += j; } cnt[x] ++; cnt[y + 1] --; } if(t % B == 0 || t == q) { int c = 0; for(int i = 1; i <= n; i ++) { c += cnt[i]; b[i] += c * a[i]; } fill(cnt, cnt + n + 1, 0); for(auto [i, j] : add) a[i] += j; add.clear(); } } for(int i = 1; i <= n; i ++) cout << b[i] << ' '; cout << '\n'; }