word=input();stack=[]
for j in range(len(word)):
#print("要加入",word[j])
if (word[j]!="") :
#print("stack",stack)
if (len(stack)!=0 and stack[-1]=="(" and word[j]==")" ):
stack.pop()
count+=1
elif (len(stack)!=0 and stack[-1]=="[" and word[j]=="]" ):
stack.pop()
count+=1
else:
stack.append(word[j])
#print(stack,len(stack))
#這樣子的寫法很神奇
if (len(stack)==0):
print("Right")
else:
print("Wrong")