/*
 * This template is valid both in C and in C++,
 * so you can expand it with code from both languages.
 * NOTE: it is recommended to use this even if you don't
 * understand the following code.
 */

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

// constraints
#define MAXD 500000
#define MAXP 500000
#define MAXE 500000

// input data
int D, P, E, i;
int A[MAXD+MAXP];
int T[MAXE], ID[MAXE];

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

    assert(3 == scanf("%d%d%d", &D, &P, &E));
    for(i=0; i<D+P; i++)
        assert(1 == scanf("%d", &A[i]));
    for(i=0; i<E; i++)
        assert(2 == scanf("%d%d", &T[i], &ID[i]));

    // insert your code here

    printf("%d\n", 42); // print the result
    return 0;
}
