2452: Parenthese sequence

内存限制:128 MB 时间限制:3.000 S
评测方式:文本比较 命题人:
提交:0 解决:0

题目描述

bobo found an ancient string. The string contains only three charaters -- "(", ")" and "?".

bobo would like to replace each "?" with "(" or ")" so that the string is valid (defined as follows). Check if the way of replacement can be uniquely determined.

Note:

An empty string is valid.
If S is valid, (S) is valid.
If U,V are valid, UV is valid.

输入

The input consists of several tests. For each tests:

A string s1s2…sn (1≤n≤106).

输出

For each tests:

If there is unique valid string, print "Unique". If there are no valid strings at all, print "None". Otherwise, print "Many".

样例输入 复制

??
????
(??

样例输出 复制