#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, i, x = 0, y = 0, z;
  string s;
  getline(cin, s);
  n = s.size();
  for (i = 0; i < n; i++) {
    if (s[i] == ' ') continue;
    if ((s[i] >= '0' && s[i] <= '9'))
      z = 1;
    else if (s[i] == ',')
      z = 2;
    else {
      z = 3;
      x = (x % 3) + 1;
    }
    if ((x == 1 && y && z == 3) || (i && y == 1 && z == 1 && s[i - 1] == ' ') ||
        y == 2)
      cout << " ";
    cout << s[i];
    y = z;
  }
}
