#include <bits/stdc++.h>
using namespace std;
int main() {
  char h;
  string m, n = "";
  getline(cin, m);
  int y = m.length();
  if (y == 0) {
    n = m;
  }
  for (int i = 0; i < y; i++) {
    if (m[i] == ' ' && (m[i + 1] > 'z' || m[i + 1] < 'a')) {
      h = m[i];
      m[i] = m[i + 1];
      m[i + 1] = h;
    }
    if (m[i] == ' ' && m[i + 1] == ' ') {
    } else {
      if ((m[i] > 'z' || m[i] < 'a') && m[i] != ' ' && m[i + 1] != ' ') {
        n += m[i];
        n += " ";
      } else {
        n += m[i];
      }
    }
  }
  cout << n;
}
