import java.io.*;
// import hsa.Console;

class Word_rearrange
{
    // static Console c = new Console();

    public static void main (String[] args) throws IOException
    {
	long initTime = System.currentTimeMillis ();
	BufferedReader br = new BufferedReader (new InputStreamReader (System.in));
	while (true)
	{
	    System.out.print("In:  ");
	    String src = br.readLine ();
	    System.out.print("Out: ");
	    int j = 0;
	    for (int i = 0 ; i < src.length () ; i++)
	    {
		if (!Character.isLetter (src.charAt (i)))
		{
		    System.out.print (rearrange (src.substring (j, i)) + src.charAt (i));
		    // c.println(src.substring (j, i));
		    j = i + 1;
		}
	    }
	    System.out.println (rearrange (src.substring (j)));
	}
    }


    static String rearrange (String src)
    {
	if (src.length () > 3)
	{
	    String str = src;
	    char[] mid = new char [src.length () - 2];
	    for (int i = 0 ; i < mid.length ; i++)
		mid [i] = src.charAt (i + 1);
	    boolean[] free = new boolean [mid.length];
	    do
	    {
		str = String.valueOf (src.charAt (0));
		for (int i = 0 ; i < free.length ; i++)
		    free [i] = true;
		for (int i = 0 ; i < mid.length ; i++)
		{
		    int r = (int) (Math.random () * mid.length);
		    int x = -1;
		    for (int j = 0 ; j < mid.length ; j++)
		    {
			x = (r + j) % free.length;
			if (free [x])
			    break;
		    }
		    str += String.valueOf (mid [x]);
		    free [x] = false;
		}
		str += String.valueOf (src.charAt (src.length () - 1));
	    }
	    while (src.equals (str));
	    return str;
	}
	return src;
    }
}
