public boolean nextPermutation(char[] s){
		int i=s.length-1, ii=0;
		
		for(;;){
			ii=i;
			i--;
			if(s[i]<s[ii]){
				int j=s.length-1;
				while(s[j]<=s[i]){
					j--;
				}
				char tmp=s[i];
				s[i]=s[j];
				s[j]=tmp;
				
				j=s.length-1;
				while(ii<j){
					tmp=s[ii];
					s[ii]=s[j];
					s[j]=tmp;
					ii++;
					j--;
				}
				return true;
			}
			
			if(i==0){
				return false;
			}
		}
	}