#include<bits/stdc++.h>
using namespace std;
int st[7000001],fi[7000001],se[7000001];
priority_queue<int> ans;
bool cmp(int a,int b)
{
return a>b;
}
int main()
{
int n,m,q,u,v,t,top,fip,sep,fis=0,ses=0,hst=0,hfi=0,hse=0,tot=0;
cin>>n>>m>>q>>u>>v>>t;
for(int i=0;i<n;i++)cin>>st[i];
sort(st,st+n,cmp);
for(int i=0;i<m;i++)
{
if(hst>n)
{
if(fi[hfi]>=se[hse])
{
top=fi[hfi];
hfi++;
}
else
{
top=se[hse];
hse++;
}
}
else if(st[hst]>=fi[hfi]&&st[hst]>=se[hse])
{
top=st[hst];
hst++;
}
else if(fi[hfi]>=se[hse])
{
top=fi[hfi];
hfi++;
}
else
{
top=se[hse];
hse++;
}
top+=tot;
fip=top*u/v;
sep=top-fip;
tot+=q;
fip-=tot;
sep-=tot;
fi[fis]=fip;
se[ses]=sep;
fis++;
ses++;
if((i+1)%t==0)cout<<top<<' ';
}
cout<<'\n';
for(int i=hst;i<n;i++)ans.push(st[i]);
for(int i=hfi;i<fis;i++)ans.push(fi[i]);
for(int i=hse;i<ses;i++)ans.push(se[i]);
for(int i=0;ans.size();i++)
{
if((i+1)%t==0)cout<<ans.top()+tot<<' ';
ans.pop();
}
return 0;
}