#include<cstdio>
#include<ctype.h>
#include<iostream>
#include <algorithm>
using namespace std;

int main(){
    int cut=1;
    char c[21]={0};
    for(int i=0;i<20;i++){
        scanf("%c",&c[i]);
        if(c[i]=='\n')break;
        cut++;
        if(1<=c[i]-'0' && 47>=c[i]-'0'){
            c[i]='\0';
            i-=1;
            cut-=1;
            }
        if(58<=c[i]-'0' && 64>=c[i]-'0'){
            c[i]='\0';
            i-=1;
            cut-=1;
            }
        if(91<=c[i]-'0' && 96>=c[i]-'0'){
            c[i]='\0';
            i-=1;
            cut-=1;
            }
        if(123<=c[i]-'0'){
            c[i]='\0';
            i-=1;
            cut-=1;
        }
    }
    for(int j=cut;j>-1;--j){
        printf("%c",c[j]);
    }
        cout <<""<<endl;
    return 0;
}