#include #define rep(i, n) for (ll i = 0; i < (n); ++i) #define rep1(i, n) for (ll i = 1; i <= (n); ++i) #define rrep(i, n) for (ll i = (n - 1); i >= 0; --i) #define ALL(obj) (obj).begin(), (obj).end() #define pb push_back #define to_s to_string #define len(v) (int)v.size() #define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) #define print(x) cout << (x) << '\n' #define debug(x) cout << #x << ": " << (x) << '\n' using namespace std; using ll = long long; typedef pair P; ll MOD = 1e9 + 7; ll devc(ll x, ll y) { return 1 + (x - 1) / y; } template struct BinaryIndexedTree { vector data; BinaryIndexedTree(int sz) { data.assign(++sz, 0); } T sum(int k) { T ret = 0; for (++k; k > 0; k -= k & -k) ret += data[k]; return (ret); } void add(int k, T x) { for (++k; k < data.size(); k += k & -k) data[k] += x; } }; int main() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(20); ll N, Q; cin >> N >> Q; BinaryIndexedTree A(N),B(N); rep(i, N){ ll a; cin >> a; A.add(i, a); } rep(i, Q){ char c; ll x, y; cin >> c >> x >> y; --x; if(c == 'A') A.add(x, y); else{ --y; for (ll j = x; j <= y; ++j){ ll t; if(j >= 1) t = A.sum(j) - A.sum(j-1); else t = A.sum(j); B.add(j, t); } } } rep(i,N){ if(i == 0) cout << B.sum(0) << " "; else{ ll x = B.sum(i) - B.sum(i-1); cout << x << " "; } } return 0; }