#include <iostream>
using namespace std;
#define MAX_EVENT 100000
int main() {
    int n, q, a, v, max_id, max_fish = -1;
    cin >> n >> q;
    int* player_id = new int [MAX_EVENT];
    int* player_fish = new int [MAX_EVENT];
    int entry = 0;
    while(q--) {
        cin >> a >> v;
        auto v1 = v;
        for(int i = 0; i < entry; i++) {
            if(player_id[i] == a) {
                v1 = player_fish[i] += v;
                break;