import java.util.*;
import java.io.*;

public class yoda_ats implements Runnable {
    StringTokenizer st;
    PrintWriter out;
    BufferedReader br;

    public static void main(String[] args) {
        new yoda_ats().run();
    }

    private void solve() throws IOException {
        st = new StringTokenizer(br.readLine(), ".");
        while (st.hasMoreTokens()) {
            String sentence = st.nextToken();
            StringTokenizer words = new StringTokenizer(sentence);
            ArrayList<String> w = new ArrayList<String>();
            while (words.hasMoreTokens()) {
                w.add(words.nextToken());
            }
            for (int i = w.size() - 1; i >= 0; i--) {
                out.print(w.get(i));
                if (i > 0) {
                    out.print(" ");
                } else {
                    out.print(".");
                    if (st.hasMoreTokens()){
                        out.print(" ");
                    }
                }
            }
        }
    }

    public void run() {
        try {
            br = new BufferedReader(new FileReader("yoda.in"));
            out = new PrintWriter("yoda.out");

            solve();

            br.close();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
}
