#include <bits/stdc++.h>
using namespace std;
#define ll long long
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<ll, null_type, greater_equal<ll>, rb_tree_tag,tree_order_statistics_node_update> ordered_set;
#define ff first
#define ss second
#define pb push_back
const int N=3e5+7;
ll mod=1e9+7;
ll ax[8]={0,0,-1,+1,-1,-1,1,1};
ll ay[8]={-1,1,0,0,-1,1,-1,1};
ll kx[8]={2,2,-2,-2,1,1,-1,-1};
ll ky[8]={1,-1,1,-1,2,-2,2,-2};
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
ll t=1;
//cin>>t;
while(t--){
ll i,j,n,k,s=0,m;
cin>>n>>k;
ordered_set st;
ll a[n];
for(i=0;i<n;i++){
cin>>a[i];
st.insert(a[i]);
}
ll ans=0;
st.insert(0);
for(i=0;i<k;i++){
cin>>s;
cout<<i<<" "<<k<<" "<<s<<" "<<st.order_of_key(s)<<"\n";
}
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbGwgbG9uZyBsb25nIAojaW5jbHVkZSA8ZXh0L3BiX2RzL2Fzc29jX2NvbnRhaW5lci5ocHA+CiNpbmNsdWRlIDxleHQvcGJfZHMvdHJlZV9wb2xpY3kuaHBwPgp1c2luZyBuYW1lc3BhY2UgX19nbnVfcGJkczsKdHlwZWRlZiB0cmVlPGxsLCBudWxsX3R5cGUsIGdyZWF0ZXJfZXF1YWw8bGw+LCByYl90cmVlX3RhZyx0cmVlX29yZGVyX3N0YXRpc3RpY3Nfbm9kZV91cGRhdGU+IG9yZGVyZWRfc2V0OwojZGVmaW5lIGZmIGZpcnN0CiNkZWZpbmUgc3Mgc2Vjb25kCiNkZWZpbmUgcGIgcHVzaF9iYWNrCmNvbnN0IGludCBOPTNlNSs3OwpsbCBtb2Q9MWU5Kzc7CmxsIGF4WzhdPXswLDAsLTEsKz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