#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll,ll>;
using ld=long double;
const ll INF=(1ll<<60);
#define rep(i,n) for (ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(),v.end()
template<class T> inline bool chmin(T &a,T b){
    if(a>b){
        a=b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T &a,T b){
    if(a<b){
        a=b;
        return true;
    }
    return false;
}
#include<atcoder/convolution>
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n,m;
    cin >> n >> m;
    vector<ll> a(n),b(m);
    rep(i,n){
        cin >> a[i];
        a[i]/=100;
    }
    sort(all(a));
    rep(i,m){
        cin >> b[i];
        b[i]=100-b[i];
    }
    sort(all(b));
    while((ll)b.size()<n) b.push_back(100);
    vector<ll> ans=atcoder::convolution_ll(a,b);
    rep(i,n) cout << ans[i] << '\n';

}