#include<iostream>
#include<cstring>
using namespace std;
bool fac(char a[],int n){
char stack[100];int top=-1;
int i=0;
for(i=0;i<n;i++){
if(a[i]=='(')
stack[++top];
if(a[i]==')'){
if(top==-1)
return false;
else
top--;
}
if(a[i]=='[')
stack[++top];
if(a[i]==']'){
if(top==-1)
return false;
else
top--;
}
if(a[i]=='{')
stack[++top];
if(a[i]=='}'){
if(top==-1)
return false;
else
top--;
}
if(a[i]!='('&&a[i]!=')'&&a[i]!='['&&a[i]!=']'&&a[i]!='{'&&a[i]!='}')
return false;
}
if(top==-1)
return true;
else
return false;
}
int main()
{
char a[100];
cin>>a;
if(fac(a,strlen(a)))
cout<<"匹配!"<<endl;
else
cout<<"不匹配!"<<endl;
return 0;
}