#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
const int INF = ((1 << 31) - 1);
const long long LLINF = (((1LL << 63) - 1LL));
const double eps = 1e-9;
const double PI = 3.14159265358979323846;
string ParseInt(string &s, int &pos) {
  string res = "";
  while (pos < s.size() && isdigit(s[pos])) res += s[pos++];
  return res;
}
string ParseThreeDots(string &s, int &pos) {
  string res = "";
  while (pos < s.size() && s[pos] == '.' && res.size() < 3) res += s[pos++];
  return res;
}
string ParseComma(string &s, int &pos) {
  ++pos;
  return string(1, ',');
}
string Parse(string &s, int &pos) {
  while (pos < s.size() && s[pos] == ' ') ++pos;
  if (pos == s.size()) return "";
  if (s[pos] == '.') return ParseThreeDots(s, pos);
  if (s[pos] == ',') return ParseComma(s, pos);
  return ParseInt(s, pos);
}
int main() {
  string s;
  getline(cin, s);
  int pos = 0;
  vector<string> tokens;
  while (pos < s.size()) {
    string next_token = Parse(s, pos);
    if (next_token == "") break;
    tokens.push_back(next_token);
  }
  for (int i = 0; i < tokens.size(); ++i) {
    if (tokens[i] == "...") {
      if (i && tokens[i - 1] != ",") printf(" ");
      printf("%s", tokens[i].c_str());
    } else if (tokens[i] == ",") {
      printf("%s", tokens[i].c_str());
      if (i + 1 != tokens.size()) printf(" ");
    } else {
      if (i && isdigit(tokens[i - 1][0])) printf(" ");
      printf("%s", tokens[i].c_str());
    }
  }
  printf("\n");
  return 0;
}
