#include <bits/stdc++.h>
using namespace std;
int main() {
  char ch;
  int state = 0;
  while ((ch = cin.get()) != EOF) switch (state) {
      case 0:
        if (isdigit(ch)) {
          cout << ch;
          state = 1;
        }
        if (ch == ',') {
          cout << ch;
          state = 2;
        }
        if (ch == ' ') {
          state = 0;
        }
        if (ch == '.') {
          cout << ch;
          state = 3;
        }
        break;
      case 1:
        if (isdigit(ch)) {
          cout << ch;
          state = 1;
        }
        if (ch == ',') {
          cout << ch;
          state = 2;
        }
        if (ch == ' ') {
          state = 6;
        }
        if (ch == '.') {
          cout << ' ';
          cout << ch;
          state = 3;
        }
        break;
      case 2:
        if (isdigit(ch)) {
          cout << ' ';
          cout << ch;
          state = 1;
        }
        if (ch == ',') {
          cout << ' ';
          cout << ch;
          state = 2;
        }
        if (ch == ' ') {
          state = 2;
        }
        if (ch == '.') {
          cout << ' ';
          cout << ch;
          state = 3;
        }
        break;
      case 3:
        if (ch == '.') {
          cout << ch;
          state = 4;
        }
        break;
      case 4:
        if (ch == '.') {
          cout << ch;
          state = 5;
        }
        break;
      case 5:
        if (isdigit(ch)) {
          cout << ch;
          state = 1;
        }
        if (ch == ',') {
          cout << ch;
          state = 2;
        }
        if (ch == ' ') {
          state = 5;
        }
        if (ch == '.') {
          cout << ' ';
          cout << ch;
          state = 3;
        }
        break;
      case 6:
        if (isdigit(ch)) {
          cout << ' ';
          cout << ch;
          state = 1;
        }
        if (ch == ',') {
          cout << ch;
          state = 2;
        }
        if (ch == ' ') {
          state = 6;
        }
        if (ch == '.') {
          cout << ' ';
          cout << ch;
          state = 3;
        }
        break;
    }
exit:
  return (0);
}
