protected int[] reverse(int d){ int []x=new int[d]; for(int i=0;i