#include using namespace std; template struct lazy_segtree { const Op op; const T e; const Apply ap; const Compose cp; const U id; const int n; vector t; vector u; lazy_segtree(int _n, Op _op, T _e, Apply _ap, Compose _cp, U _id) : op(_op), e(_e), ap(_ap), cp(_cp), id(_id), n(_n), t(2 * n, e), u(n, id) {} T& operator[](int i) { return t[n + i]; } void build() { for (int i = n; i-- > 1; ) t[i] = op(t[2 * i], t[2 * i + 1]); } void push() { for (int i = 1; i < n; ++i) push(i); } void apply(int i, U f) { t[i] = ap(t[i], f); if (i < n) u[i] = cp(u[i], f); } void push(int i) { apply(2 * i, u[i]), apply(2 * i + 1, u[i]); u[i] = id; } void propagate(int i) { for (int h = __lg(i), tz = __builtin_ctz(i); h > tz; --h) push(i >> h); } T fold(int l, int r) { propagate(l += n), propagate(r += n); T a = e, b = e; for (; l < r; l >>= 1, r >>= 1) { if (l & 1) a = op(a, t[l++]); if (r & 1) b = op(t[--r], b); } return op(a, b); } T get(int i) { return fold(i, i + 1); } void act(int l, int r, U f) { propagate(l += n), propagate(r += n); for (int i = l, j = r; i < j; i >>= 1, j >>= 1) { if (i & 1) apply(i++, f); if (j & 1) apply(--j, f); } l = l >> __builtin_ctz(l); while (l >>= 1) t[l] = op(t[2 * l], t[2 * l + 1]); r = r >> __builtin_ctz(r); while (r >>= 1) t[r] = op(t[2 * r], t[2 * r + 1]); } void set(int i, T a) { propagate(i += n), propagate(i + 1); t[i] = a; while (i >>= 1) t[i] = op(t[2 * i], t[2 * i + 1]); } }; template auto make_lazy_segtree(int n, Op op, T e, Apply ap, Compose cp, U id) { return lazy_segtree(n, op, e, ap, cp, id); } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, q; cin >> n >> q; using p = pair; auto st = make_lazy_segtree

(n, [](auto l, auto r) -> p { return {l.first + r.first, l.second + r.second}; }, {0, 0}, [](auto a, auto f) -> p { return {a.first + a.second * f, a.second}; }, [](auto f, auto g) { return f + g; }, 0LL); for (int i = 0; i < n; ++i) { int a; cin >> a; st[i] = {0, a}; } st.build(); while (q--) { char c; cin >> c; if (c == 'A') { int i, x; cin >> i >> x; --i; auto e = st.get(i); st.set(i, {e.first, e.second + x}); } else { int l, r; cin >> l >> r; --l; st.act(l, r, 1); } } st.push(); for (int i = 0; i < n; ++i) { cout << st[i].first << " \n"[i == n - 1]; } }