#include <bits/stdc++.h>
int main() {
  char dizi[10000], c;
  int a = 0, i = 0;
  while (571) {
    scanf("%c", &c);
    if (c == '\n') break;
    if (c == ' ' && dizi[a - 1] == ' ') continue;
    if (c == ',' || c == '.' || c == '!' || c == '?') {
      if (dizi[a - 1] == ' ') {
        dizi[a - 1] = c;
        dizi[a++] = ' ';
        continue;
      } else {
        dizi[a] = c;
        dizi[a + 1] = ' ';
        a += 2;
        continue;
      }
    }
    dizi[a++] = c;
  }
  for (i = 0; i < a; i++) printf("%c", dizi[i]);
  printf("\n");
  return 0;
}
