#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long ConvertToInt(string s) {
  stringstream geek(s);
  long long x = 0;
  geek >> x;
  return x;
}
bool CheckConsecutive(long long num) {
  double dou = log2(num);
  int ans = dou;
  if (ans == dou)
    return true;
  else
    return false;
}
string ConverToString(long long n) {
  string Result;
  stringstream convert;
  convert << n;
  Result = convert.str();
  return Result;
}
long long arr1[1000000], arr2[1000000];
const long long md = 1e9 + 7;
const double PI = 3.141592654;
int main() {
  fast();
  string s;
  string ss = "";
  getline(cin, s);
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != ' ' && s[i] != ',' && s[i] != '?' && s[i] != '!' &&
        s[i] != '.') {
      ss += s[i];
    } else if (s[i] == ' ' && s[i - 1] >= 97 && s[i - 1] <= 128 &&
               (s[i + 1] >= 97 && s[i + 1] <= 128 || s[i + 1] == ' ')) {
      ss += s[i];
    } else if (s[i] == '.' || s[i] == '?' || s[i] == '!' || s[i] == ',') {
      ss += s[i];
      ss += ' ';
    }
  }
  for (int i = 0; i < ss.size(); i++) {
    if (ss[i] == ' ' && (ss[i + 1] == '.' || ss[i + 1] == '?' ||
                         ss[i + 1] == '!' || ss[i + 1] == ',')) {
      continue;
    } else {
      cout << ss[i];
    }
  }
  cout << "\n";
  return 0;
}
