#include <bits/stdc++.h>
using namespace std;
int main() {
  int spaces = 0, commas = 0, dots = 0, begin = 1, dotbef = 0;
  char tmp;
  while (scanf("%c", &tmp) == 1) {
    if (tmp == ' ') ++spaces;
    if (tmp == ',') dotbef = begin = 0, ++commas;
    if (commas == 2) --commas, printf(", ");
    if (tmp == '.') dotbef = 1, ++dots;
    if (dots == 3) {
      if (commas) commas = 0, printf(",");
      if (!begin) printf(" ");
      begin = spaces = dots = 0, printf("...");
    }
    if (tmp >= '0' && tmp <= '9') {
      begin = 0;
      if (commas == 1) spaces = commas = 0, printf(", ");
      if (spaces != 0 && !dotbef) printf(" ");
      spaces = dotbef = 0, printf("%c", tmp);
    }
    if (tmp != ' ') spaces = 0;
  }
  if (commas != 0) commas = 0, printf(",");
  printf("\n");
  return 0;
}
