Problem:
Score : 200 points

Problem Statement

You are given a image with a height of H pixels and a width of W pixels.
Each pixel is represented by a lowercase English letter.
The pixel at the i-th row from the top and j-th column from the left is a_{ij}.

Put a box around this image and output the result. The box should consist of # and have a thickness of 1.

Constraints

1 ≤ H, W ≤ 100

a_{ij} is a lowercase English letter.

Input

Input is given from Standard Input in the following format:

H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW}

Output

Print the image surrounded by a box that consists of # and has a thickness of 1.

Sample Input 1

2 3
abc
arc

Sample Output 1

#####
#abc#
#arc#
#####

Sample Input 2

1 1
z

Sample Output 2

###
#z#
###

Solution in Java8 (OpenJDK 1.8.0) (judge verdict: Wrong Answer)

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	
	private static int count;
	public static char used;
	public static String comment = "";

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String words = sc.next();

		char[] c = words.toCharArray();

		List<Character> list = new ArrayList<>();

		for (int i = 0; i < c.length; i++) {
			list.add(c[i]);
		}
		used = c[0];

		list.stream()
			.sorted((a,b) -> b - a)
			.forEach(i -> comment(count(i)));
		
		System.out.println(comment);
	}
	
	public static boolean count(char c) {
		
		if(used == c) {
			count++;
		} else if(count % 2 == 1) {
			return false;
		} else {
			count = 1;
		}
		return true;
	}
	
	public static void comment(boolean b) {
		
		if(comment.equals("No")) {return;}
		
		if(b) {
			comment = "Yes";
		} else {
			comment = "No";
		}
	}

}