#include <bits/stdc++.h>
using namespace std;
FILE *in, *out;
ifstream fin("input.in");
ofstream fout("output.out");
string str;
void oku() {
  getline(cin, str);
  str += 'X';
}
void coz() {
  for (int i = 0; i <= str.size() - 2; i++) {
    if (isalpha(str[i]) || ((str[i]) >= '!' && (str[i]) <= '?') ||
        isalpha(str[i + 1])) {
      cout << str[i];
      if (((str[i]) >= '!' && (str[i]) <= '?')) str[i] = 32, i--;
    }
  }
}
int main() {
  oku();
  coz();
}
