#include <cstring>
#include <iostream>
#include <string>
#include <cstdio>
#include <cmath>
using namespace std;
int main() {
string s;
while (cin >> s) { // 注意 while 处理多个 case
int n;
for(int i=0;i!=-1;i++)
if(!s[i]){
n=i;
i=-2;
}
int l[n];
int j=0;
for(int i=0;i<n-1;i++)
if(s[i]!='#'){
l[j]=s[i];
j++;
}
else
printf("%c ",l[--j]);
}
return 0;
}
// 64 位输出请用 printf("%lld")



京公网安备 11010502036488号