#include<stdio.h>
#include<string.h>
#include<stack>
using namespace std;
stack<char>s;
int main()
{
char ch[1000],sh[1000];
while(scanf("%s",sh)!=EOF)
{
int len=strlen(sh);
for(int i=0;i<len;i++)
{
if(sh[i]!='#'&&sh[i]!='@')
{
s.push(sh[i]);
}
else if(sh[i]=='#'&&!s.empty())
s.pop();
else if(sh[i]=='@')
{
while(!s.empty())
{
s.pop();
}
}
}
int j=0;
while(!s.empty())
{
ch[j++]=s.top();//出栈时的字符顺序是反的,要另存
s.pop();
}
ch[j]='\0';//数组的结束标志
for(int i=j-1;i>=0;i--)
printf("%c",ch[i]);
printf("\n");
}
return 0;
}