#include <bits/stdc++.h>
using namespace ::std;
class Mytype {
 public:
  int type;
  string str;

 public:
  Mytype(int a_type, string a_str) {
    type = a_type;
    str = a_str;
  }
  Mytype() {
    type = -1;
    str = "";
  }
};
int main() {
  string str;
  vector<Mytype> partens;
  string::size_type i, len, j;
  vector<Mytype>::iterator part_it, temp;
  int lastType = -1;
  getline(cin, str);
  len = str.length();
  for (i = 0; i < len; i++) {
    if (str[i] == ',') {
      partens.push_back(Mytype(1, ", "));
    } else if (!str.substr(i, 3).compare("...")) {
      i += 2;
      partens.push_back(Mytype(2, " ..."));
    } else if (isdigit(str[i])) {
      j = i + 1;
      while (j < len && isdigit(str[j])) {
        j++;
      }
      j--;
      partens.push_back(Mytype(0, str.substr(i, j - i + 1)));
      i = j;
    }
  }
  for (part_it = partens.begin(); part_it != partens.end(); part_it++) {
    temp = part_it.operator+(1);
    if (part_it->type == 2 && part_it == partens.begin()) {
      (part_it->str).erase((part_it->str).begin());
      cout << part_it->str;
    } else if (part_it->type == 1 && temp == partens.end()) {
      (part_it->str).erase((part_it->str).end().operator--());
      cout << part_it->str;
    } else if (part_it->type == 0 && lastType == 0) {
      cout << ' ' << part_it->str;
    } else if (part_it->type == 2 && lastType == 1) {
      (part_it->str).erase((part_it->str).begin());
      cout << part_it->str;
    } else {
      cout << part_it->str;
    }
    lastType = part_it->type;
  }
  return 0;
}
