// Collection of code snippets by Arne VajhÃ¸j 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.*;

public class Shuffle {
    public static String shuffle(String s) {
        List<Character> lst = new ArrayList<Character>();
        for(int i = 1; i < s.length() - 1; i++) lst.add(s.charAt(i));
        Collections.shuffle(lst);
        StringBuffer sb = new StringBuffer();
        sb.append(s.charAt(0));
        for(int i = 0; i < lst.size(); i++) sb.append(lst.get(i));
        sb.append(s.charAt(s.length() - 1));
        return sb.toString();
    }
    public static void main(String[] args) {
        for(int i = 0; i < 10; i ++) {
            System.out.println(shuffle("Søren"));
        }
    }
}
