#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);
int pos;
char str[1000];
string ans;
int main() {
  while (gets(str) != NULL) {
    ans = "";
    int len = strlen(str);
    pos = 0;
    char prev = 0;
    while (pos < len) {
      if (str[pos] == ',') {
        ans += ",";
        if (pos + 1 != len) {
          ans += " ";
        }
        pos++;
        prev = ' ';
      } else if (str[pos] == '.') {
        assert(str[pos + 1] == '.');
        assert(str[pos + 2] == '.');
        if ((prev == ' ' && ans.empty()) ||
            (!ans.empty() && *ans.rbegin() != ' ')) {
          ans += " ";
        }
        ans += "...";
        pos += 3;
        prev = '.';
      } else if (str[pos] == ' ') {
        if (prev != '.') {
          prev = ' ';
        }
        pos++;
      } else if (isdigit(str[pos])) {
        if (prev == ' ' && !ans.empty() && *ans.rbegin() != ' ') {
          ans += " ";
        }
        ans += str[pos];
        pos++;
        prev = '1';
      } else {
        assert(false);
      }
    }
    cout << ans << endl;
  }
}
