#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 5, INF = 1e9 + 7;
string s;
vector<char> a;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  getline(cin, s);
  for (int i = 0; i < s.size(); ++i) {
    if (a.size() == 0)
      a.push_back(s[i]);
    else {
      char pr = a.back();
      if (pr >= '0' && pr <= '9') {
        if (s[i] == ',' || s[i] >= '0' && s[i] <= '9' || s[i] == ' ')
          a.push_back(s[i]);
        else if (s[i] == '.')
          a.push_back(' '), a.push_back(s[i]);
      }
      if (pr == ',') a.push_back(' '), a.push_back(s[i]);
      if (pr == '.') {
        if (s[i] >= '0' && s[i] <= '9' || s[i] == ',')
          a.push_back(s[i]);
        else {
          if (a.size() >= 3) {
            char k1 = a[a.size() - 1], k2 = a[a.size() - 2],
                 k3 = a[a.size() - 3];
            if (s[i] == '.')
              if (k1 == '.' && k2 == '.' && k3 == '.') a.push_back(' ');
          }
          a.push_back(s[i]);
        }
      }
      if (pr == ' ') {
        if (s[i] != ' ') a.push_back(s[i]);
      }
    }
  }
  for (int i = 0; i < a.size() - 1; ++i) {
    if (a[i] == ' ' && a[i + 1] == ' ' ||
        a[i] == ' ' && a[i + 1] == ',' && a[i - 1] >= '0' && a[i - 1] <= '9' ||
        a[i - 1] == '.' && a[i] == ' ' && a[i + 1] >= '0' && a[i + 1] <= '9' ||
        a[i - 1] == '.' && a[i] == ' ' && a[i + 1] == ',')
      a.erase(a.begin() + i, a.begin() + i + 1);
  }
  for (int i = 0; i < a.size(); ++i) {
    cout << a[i];
  }
}
