public static void sort(Comparable[] a){
		int N = a.length, h = 1;
//		while(h < N/3) h = 3*h + 1;
		while(h < N/3) h = 3*h ;
		while(h>=1){
			for(int i = h; i < N; i++){
				for(int j = i; j>=h; j-=h){
					if(a[j].compareTo(a[j-h]) < 0){
						Comparable tmp = a[j-h];
						a[j-h] = a[j];
						a[j] = tmp;
					}
				}
			}
			h /= 3;
		}
	}