/*
 * This template is valid both in C and in C++,
 * so you can expand it with code from both languages.
 */

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

// constraints
#define MAXN 500000

// input data
int N, M, i;
long long A[MAXN];
int E[MAXN];

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(2 == scanf("%d %d", &N, &M));
    for (i=0; i<N; i++)
        assert(1 == scanf("%lld", &A[i]));
    for (i=0; i<M; i++)
        assert(1 == scanf("%d", &E[i]));

    for (i=0; i<M; i++) {
        
        // and also here
        
        printf("%lld ", 42L); // change 42L with actual (long long) answer for i-th group
    }
    printf("\n");
    return 0;
}
