#include <bits/stdc++.h>
using namespace std;
int pre = -1, cur = -1;
string s;
int main() {
  getline(cin, s);
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == ' ') continue;
    if (isdigit(s[i])) cur = 3;
    if (s[i] == ',') cur = 4;
    if (s[i] == '.') {
      if (cur == -1 || cur > 2)
        cur = 0;
      else
        cur = (cur + 1) % 3;
    }
    if (pre == 4 || cur == 0 && pre != -1 ||
        pre == 3 && cur == 3 && s[i - 1] == ' ')
      cout << " ";
    cout << s[i];
    pre = cur;
  }
}
