#include <bits/stdc++.h>
using namespace std;
int isMark(char ch) { return ch == ',' || ch == '?' || ch == '!' || ch == '.'; }
int main() {
  string str;
  getline(cin, str);
  string str1 = "";
  for (int i = 0; i < str.length(); i++) {
    if (str[i] != ' ') {
      str1 += str[i];
    } else if (isMark(str[i + 1]) == 0 && str[i + 1] != ' ' &&
               *((str1.end()) - 1) != ' ') {
      str1 += str[i];
    }
    if (isMark(*((str1.end()) - 1)) == 1) str1 += ' ';
  }
  cout << str1;
}
