public static void sort ( String prefix, String [] a ) {
	// when a.length = 1, one lexicographic permutation compeleted 
	if ( a.length == 1 ) {
	    counter++;
	}

	// get the value of millionth time
	if ( counter == 1000000 ) {
	    System.out.println("result = "+prefix+a[0]);
	    System.exit(0);
	}

	// use recursion for permutation
	for ( int i=0; i<a.length; i++ ) {
	    sort(prefix + a[i], copy(a,i));
	}
    }