#include<bits/stdc++.h>

using namespace std;

typedef vector<int> vi;

int main() {
    int m;
    cin >> m;

    vi menu(m);
    for (auto&x : menu) cin >> x;

    int n, e;
    cin >> n >> e;

    vi belt(n+1), ans(n);

    int chef_i = 0, chef_t = 0;

    while (e--) {
        int t, p;
        cin >> t >> p;

        for (;chef_t < t; ++chef_t) {
            if (!belt[0]) belt[0] = menu[chef_i%m], ++chef_i;
            rotate(belt.begin(), belt.end()-1, belt.end());
        }

        ans[p-1] += belt[p];
        belt[p] = 0;
    }

    for (auto x : ans) cout << x << '\n';

    return 0;
}