#include #include using namespace std; const int LEN_MAX = 1000; char s[LEN_MAX]; void rescrie(char *s) { int n = strlen(s); for (int i = 0; i < n; i++) { if (s[i] == '.') continue; if (s[i] == '-') continue; if (s[i] == ',') { if (i == 0 || s[i - 1] != ' ') cout << ' '; cout << s[i]; continue; } cout << s[i]; } cout << '\n'; } int main() { cin.getline(s, 1000); rescrie(s); return 0; }