#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    vector<ll> a(n), b(m);
    for(auto &&v : a){
        cin >> v;
        v /= 100;
    }
    for(auto &&v : b){
        cin >> v;
        v = 100 - v;
    }
    while(b.size() < n) b.push_back(100);
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    auto c = atcoder::convolution_ll(a, b);
    for(int i = 0; i < n; i++) cout << c[i] << '\n';
}