#include
using namespace std;
int main()
{ int test_case,l,c,L,C,h,w;
cin>>test_case;
while(test_case!=0)
{
cin>>l>>c>>h>>w;
L=(l+1)+(lh);
C=(c+1)+(cw);
for(int i=0;i<L;i++)
{
for(int j=0;j<C;j++)
{
if((i%(h+1)==0)||(j%(w+1)==0))
cout<<"*"<<" “;
else
cout<<”."<<" “;
}
cout<<”\n";
}
test_case–;
}
}