#include <iostream>
#include <algorithm>
#include <deque>
#include<iterator>
using namespace std;
int main() {
    int a[10000],c[10000];
    int b[1000];
    int d = 0;
    int br = 0;
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    int z = sizeof(a) / sizeof(a[0]);
    sort(a, a+z);
    for (int i = 0; i < m; i++) {
        cin >> b[i];
    }
    for (int i = 0; i < m; i++) {
        cout << a[5] << endl;
    }
}