#!/usr/bin/env python3 # NOTE: it is recommended to use this even if you don't understand the following code. import sys # uncomment the two following lines if you want to read/write from files # sys.stdin = open('input.txt') # sys.stdout = open('output.txt', 'w') N, K = map(int, input().strip().split()) T = list(map(int, input().strip().split())) M = int(input().strip()) A = [0 for i in range(M)] B = [0 for i in range(M)] for i in range(M): A[i], B[i] = map(int, input().strip().split()) P = 0 # INSERT YOUR CODE HERE print(P) sys.stdout.close()