static String clockwise(int size) {
		int[][] array=new int[size][size];
		int i=size/2, j=size/2, next=1, max=size*size, len=1;
		while(next<=max){
			
			for(;i<size/2+len/2;i++){
				array[i][j]=next++;
			}
			
			for(;j>size/2-len/2;j--){
				array[i][j]=next++;
			}
			
			for(;i>size/2-len/2;i--){
				array[i][j]=next++;
			}
			
			for(;j<=size/2+len/2;j++){
				array[i][j]=next++;
			}
			len+=2;
		}

		StringBuilder sb=new StringBuilder();
		for(int x=0;x<size;x++){
			for(int y=0;y<size;y++){
				sb.append(array[x][y]);
				if(y!=size-1){
					sb.append('*');
				}
			}
			if(x!=size-1){
				sb.append('\n');
			}
		}
		return sb.toString();
    }