#include <bits/stdc++.h>
using namespace std;
char c[10010];
int main() {
  string cur;
  int num = 0;
  while (cin >> cur) {
    if (cur[0] != '.' && cur[0] != '?' && cur[0] != ',' && cur[0] != '!' &&
        num != 0)
      cout << ' ';
    for (int i = 0; i < cur.length(); i++) {
      cout << cur[i];
      if (cur[i] == '.' || cur[i] == '?' || cur[i] == ',' || cur[i] == '!') {
        if (i != cur.length() - 1) cout << ' ';
      }
    }
    num++;
  }
}
