#include <stdio.h>
#include<stdlib.h>
int main()
{
int ch;
int count = 0;
while ((ch = getchar()) != EOF)
{
if (ch == '{')
{
count++;
}
else if (ch == '}')
{
if (count == 0)
{
printf("不成功匹配\n");
}
else
{
count--;
}
}
}
if (count == 0)
{
printf("成功匹配!\n");
}
else
{
printf("不成功匹配!\n");
}
system("pause");
return 0;
}