#include<bits/stdc++.h>
using namespace std;
string s;
int a[101];
int main(){
cin>>s;
for(int i=0;i<s.length();i++){
if(s[i]==')'){
for(int j=i-1;j>=0;j--){
if(s[j]=='('&&a[j]==0){
a[i]=a[j]=1;
break;
}
else if(s[j]=='['&&a[j]==0)break;
}
}
else if(s[i]==']'){
for(int j=i-1;j>=0;j++){
if(s[j]=='['&&a[j]==0){
a[i]=a[j]=1;
break;
}
else if(s[j]=='('&&a[j]==0)break;
}
}
}
for(int i=0;i<s.length();i++){
if(a[i]==0){
if(s[i]=='('||s[i]==')')
cout<<"()";
else cout<<"[]";
}
else cout<<s[i];
}
return 0;
}
救命啊大大们,新手根本搞不定这道题.....6绿3紫3红(无奈) 哪个好心人帮帮忙(求)