#include <stdlib.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <list>
#include <stack>
#include <cstring>
using namespace std;
bool check(string s, stack<char> mystack) {
for (string::iterator it = s.begin(); it != s.end(); it++)
{
if (*it == '(' || *it == '{' || *it == '[')
{
mystack.push(*it);
}
else
{
if (*it == ')')
{
if (mystack.empty())
return false;
if (mystack.top() != '(')
return false;
else
mystack.pop();
}
if (*it == ']')
{
if (mystack.empty())
return false;
if (mystack.top() != '[')
return false;
else
mystack.pop();
}
if (*it == '}')
{
if (mystack.empty())
return false;
if (mystack.top() != '{')
return false;
else
mystack.pop();
}
}
}
if (mystack.empty())
return true;
else
return false;
}
int main()
{
string s;
cin >> s;
stack<char> mys;
bool t = check(s, mys);
if (t == 1)
cout << "complete" << endl;
else
cout << "failed" << endl;
}