#include<iostream>
using namespace std;int main(){int w,h,i;for(;cin>>h>>w;cout<<endl)for(i=w*h+1;--i;)cout<<".#"[((i-1)/w+1)%h<2||i%w<2],!(i%w-1)&&cout<<endl;}
I2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7aW50IG1haW4oKXtpbnQgdyxoLGk7Zm9yKDtjaW4+Pmg+Pnc7Y291dDw8ZW5kbClmb3IoaT13KmgrMTstLWk7KWNvdXQ8PCIuIyJbKChpLTEpL3crMSklaDwyfHxpJXc8Ml0sIShpJXctMSkmJmNvdXQ8PGVuZGw7fQ==