// NOTE: it is recommended to use this even if you don't understand the following code.

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>

#define MAXQ 200000
#define MAXN 200000

int N, Q, i;
int A[MAXN];
int C[MAXQ], X[MAXQ];
int ans[MAXQ + 1];

int main() {
    // uncomment the two following lines if you want to read/write from files
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    assert(2 == scanf("%d%d", &N, &Q));

    for (i = 0; i < N; ++i)
        assert(1 == scanf("%d", &A[i]));

    for (i = 0; i < Q; ++i)
        assert(2 == scanf("%d%d", &X[i], &C[i]));



    // INSERT YOUR CODE HERE


    for (i = 0; i < Q + 1; ++i)
        printf("%d ", ans[i]);
    printf("\n");

    return 0;
}
