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

public class yoda_akov {
	FastScanner in;
	PrintWriter out;

	public void solve() throws IOException {
		String[] sentences = in.br.readLine().split("[.]");
		for (int iter = 0; iter < sentences.length; iter++) {
			String sentence = sentences[iter].trim();
			String[] s = sentence.split("[ ]");
			int l = 0, r = s.length - 1;
			while (l < r) {
				String tmp = s[l];
				s[l] = s[r];
				s[r] = tmp;
				l++;
				r--;
			}
			for (int i = 0; i < s.length; i++) {
					out.print(s[i]);
					if (i != s.length - 1) {
						out.print(" ");
				}
			}
			out.print(".");
			if (iter != sentences.length - 1) {
				out.print(" ");
			}
		}
		out.println();
	}

	public void run() {
		try {
			in = new FastScanner(new File("yoda.in"));
			out = new PrintWriter(new File("yoda.out"));

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		FastScanner(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

	}

	public static void main(String[] arg) {
		new yoda_akov().run();
	}
}