private ArrayList<Integer> print(int[][] matrix, int top, int left, int bottom, int right) {
		ArrayList<Integer> result = new ArrayList<Integer>();
		// top
		if (top <= bottom) {
			for (int i = left; i <= right; i++) {
				result.add(matrix[top][i]);
			}
		}
		// right
		if (right >= left) {
			for (int i = top + 1; i <= bottom; i++) {
				result.add(matrix[i][right]);
			}
		}
		// bottom
		if (bottom > top) {
			for (int i = right - 1; i >= left; i--) {
				result.add(matrix[bottom][i]);
			}
		}
		// left
		if (left < right) {
			for (int i = bottom - 1; i > top; i--) {
				result.add(matrix[i][left]);
			}
		}
		// recursion to print inner
		if (result.size() != 0) {
			result.addAll(print(matrix, top + 1, left + 1, bottom - 1, right - 1));
		}
		return result;
	}