全RE
#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
string pass()
{
string s="",x;
char c;
int d;
while(cin>>c)
{
if(c=='[')
{
cin>>d;
x=pass();
while(d--)
{
s+=x;
}
}
else
{
if(c==']')
{
return s;
}
else s+=c;
}
}
}
int main()
{
cout<<pass();
return 0;
}