#include <iostream>                                                                                                                                                                                         
#include <cstdio>                                                                                                                                                                                           
#include <set>                                                                                                                                                                                              
using namespace std;                                                                                                                                                                                        
                                                                                                                                                                                                            
int main(){                                                                                                                                                                                                 
    int H, W;                                                                                                                                                                                               
    cin >> H >> W;                                                                                                                                                                                          
                                                                                                                                                                                                            
    const int MAX_H = 100;                                                                                                                                                                                  
    const int MAX_W = 100;                                                                                                                                                                                  
    char a[MAX_H][MAX_W] = {};                                                                                                                                                                              
    for(int i=0;i<H;i++){                                                                                                                                                                                   
        for(int j=0;j<W;j++){                                                                                                                                                                               
            cin >> a[i][j];                                                                                                                                                                                 
        }                                                                                                                                                                                                   
    }                                                                                                                                                                                                       
                                                                                                                                                                                                            
    for(int i=0;i<W+2;i++){                                                                                                                                                                                 
        cout << "#";                                                                                                                                                                                        
    }                                                                                                                                                                                                       
    cout << endl;                                                                                                                                                                                           
                                                                                                                                                                                                            
    for(int i=0;i<H;i++){                                                                                                                                                                                   
        cout << "#";                                                                                                                                                                                        
        for(int j=0;j<W;j++){                                                                                                                                                                               
            cout << a[i][j];                                                                                                                                                                                
        }                                                                                                                                                                                                   
        cout << "#" << endl;                                                                                                                                                                                
    }                                                                                                                                                                                                       
    for(int i=0;i<W+2;i++){                                                                                                                                                                                 
        cout << "#";                                                                                                                                                                                        
    }                                                                                                                                                                                                       
    cout << endl;                                                                                                                                                                                           
    return 0;                                                                                                                                                                                               
} 

Measured memory_bytes: 256