#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  getline(cin, s);
  vector<char> v, v1;
  bool q = 0, w = 0;
  int k = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '.') k++;
    if (s[i] == '.' && !w) {
      v.push_back(' ');
      w = 1;
    }
    if (k % 4 == 0 && k != 0) {
      v.push_back(' ');
      k++;
    }
    if (s[i] == ' ' && !q) {
      v.push_back(' ');
      q = 1;
    }
    if (s[i] != ' ') {
      v.push_back(s[i]);
      q = 0;
    }
    if (s[i] == ',') v.push_back(' ');
  }
  int ind, ind1;
  q = 0;
  for (int i = 0; i < v.size(); i++) {
    if (v[i] != ' ') {
      ind = i;
      break;
    }
  }
  for (int i = v.size() - 1; i >= 0; i--) {
    if (v[i] != ' ') {
      ind1 = i;
      break;
    }
  }
  for (int i = ind; i <= ind1; i++) {
    if (v[i] != ' ') {
      v1.push_back(v[i]);
      q = 0;
    } else if (!q) {
      v1.push_back(v[i]);
      q = 1;
    }
  }
  for (int i = 0; i < v1.size(); i++) {
    if (v1[i] == ',' && v1[i - 1] == ' ' && v1[i - 2] != ',' && i != 0) {
      v1[i - 1] = '#';
    }
    if ((v1[i] >= '0' && v[i] <= '9') && v1[i - 1] == ' ' && v1[i - 2] == '.' &&
        i != 0) {
      v1[i - 1] = '#';
    }
  }
  for (int i = 0; i < v1.size(); i++) {
    if (v1[i] != '#') cout << v1[i];
  }
  return 0;
}
