#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[10005], f[10005];
  gets(s);
  int i, j, k, l;
  l = strlen(s);
  k = 0;
  for (i = 0; i < l; i++) {
    if (s[i] > 64) {
      f[k++] = s[i];
    } else if (s[i] == 32) {
      while (s[i] == 32) i++;
      if (s[i] > 64) {
        f[k++] = 32;
        f[k++] = s[i];
      } else {
        f[k++] = s[i];
        f[k++] = 32;
        i++;
        while (s[i] == 32) i++;
        if (s[i] > 64) f[k++] = s[i];
      }
    } else {
      f[k++] = s[i];
      f[k++] = 32;
      i++;
      while (s[i] == 32) i++;
      if (s[i] > 64) f[k++] = s[i];
    }
  }
  puts(f);
  return 0;
}
