#include<iostream>
using namespace std;
int main()
{
char c;
int count = 0;
while ((c = getchar()) != EOF)
{
if ('{' == c)
{
count++;
}
else if ('}' == c&&0!=count)
{
count--;
}
else if ('}' == c && 0 == count)
{
cout << "不匹配" << endl;
}
}
if (count == 0)
{
cout << "匹配" << endl;
}
else
{
cout << "不匹配" << endl;//不要忘记判断不等于0的情况
}
system("pause");
}