/*
Author : Shohanur Rahaman
*/
#include<stack>
#include<cstdio>
#include<iostream>
#include<string>
using namespace std;
bool checkMatch(char open,char close)
{
if(open == '(' && close == ')') return true;
else if(open == '{' && close == '}') return true;
else if(open == '[' && close == ']' ) return true;
else false;
}
bool checkBalance(string str)
{
stack <char> mystack;
for(int i=0;i<str.length();i++){
if(str[i] == '(' || str[i] == '{' || str[i] == '['){
mystack.push(str[i]);
}
else if(str[i]==')' || str[i]=='}' || str[i] == ']'){
if(mystack.empty() || !checkMatch(mystack.top(),str[i]))
return false;
else
mystack.pop();
}
}
if(mystack.empty() == true)
return true;
else
return false;
}
int main()
{
string exp;
while(cin>>exp){
if(checkBalance(exp)){
cout<<"correct"<<endl;
}
else
cout<<"incorrect"<<endl;
}
return 0;
}