#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
int main(){
	char ans[50][10000] = {{0}};
	char a[10000] = {0};
	scanf("%[^\n]",a);
	int cnt = 0;
	int mx_len = 0;
	char date[10000] = {0};
	int j = 0;
	int len = 0;
	for(int i = 0; a[i] != 0; i++) len++;
	for(int i = 0; i <= len; i++){
        if('a' <= a[i] && a[i] <= 'z' || 'A' <= a[i] && a[i] <= 'Z'){
            ans[cnt][j] = a[i];
            j++;
        }
        else{
            cnt++;
            j = 0;
        }
	}
	for(int i = 0; i < cnt; i++){
        cout << ans[i] << endl;
	}
	return 0;
}