#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int n, i, j, t;
  char in[256], out[512], c;
  bool empty, num, e2;
  n = 0;
  while ((in[n] = getchar()) != '\n') n++;
  in[n] = 0;
  t = 0;
  e2 = false;
  num = false;
  empty = false;
  for (i = 0, j = 0; i < n; i++) {
    if (in[i] >= '0' && in[i] <= '9') {
      if (e2) {
        sprintf(&out[j], " ");
        j++;
        e2 = false;
        num = false;
      }
      sprintf(&out[j], "%c", in[i]);
      j++;
      empty = true;
      num = true;
      t = 0;
    }
    if (in[i] == ',') {
      sprintf(&out[j], "%c", in[i]);
      j++;
      sprintf(&out[j], " ");
      j++;
      empty = false;
      num = false;
      e2 = false;
      t = 0;
    }
    if (in[i] == ' ') {
      if (num) {
        e2 = true;
      }
    }
    if (in[i] == '.') {
      if (empty || t == 3) {
        sprintf(&out[j], " ");
        j++;
        empty = false;
        t = 0;
      }
      sprintf(&out[j], "%c", in[i]);
      j++;
      t++;
      e2 = false;
      num = false;
    }
  }
  while (out[j - 1] == ' ') {
    j--;
    out[j] = 0;
  }
  printf("%s\n", out);
  return EXIT_SUCCESS;
}
