#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

struct BIT {
    BIT(int n) : b(n + 1), n(n) {}
    void add(int i, int v) {
        for (int k = i + 1; k <= n; k += k & -k) b[k] += v;
    }
    int sum(int k) {
        int s = 0;
        for (; k > 0; k -= k & -k) s += b[k];
        return s;
    }
    vector<int> b;
    int n;
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n, q;
    cin >> n >> q;

    vector<ll> a(n), b(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    BIT bt(n + 1);

    for (int h = 0; h < q; h++) {
        char c;
        int x, y;
        cin >> c >> x >> y;
        x--;

        if (c == 'A') {
            a[x] += y;
            b[x] += (ll)y * bt.sum(x + 1);

        } else {
            bt.add(x, +1);
            bt.add(y, -1);
        }
    }

    for (int i = 0; i < n; i++) {
        cout << a[i] * bt.sum(i + 1) - b[i] << " \n"[i == n - 1];
    }

    return 0;
}