
tle="" align="" />
#include<bits/stdc++.h>
using namespace std;
stack<char>st;
int main()
{
int f=0,i=1;
char a[256];
while(cin>>a[i]){
if(a[i]=='['||a[i]=='('){
st.push(a[i]);
}else if(a[i]==']'||a[i]==')'){
if(!st.empty()){
if(a[i]==']'){
if(st.top()=='[') st.pop();
else f=1;
}else if(a[i]==')'){
if(st.top()=='(') st.pop();
else f=1;
}
}else f=1;
}
i++;
}
if(f==1||!st.empty()){
cout<<"Wrong";
}else{
cout<<"OK";
}
return 0;
}