/**************Powered by Graphene Richards**************/ extern"C++"{ #define FLOAT_PRECISION 2 #ifdef _MSC_VER #define _SECURE_SCL 0 #pragma comment(linker,"/STACK:102400000,102400000") #else #pragma GCC optimize("O3") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx") #endif #if defined(_MSC_VER)||__cplusplus>199711L #define IT(x) auto #define DIT(x) auto #else #define IT(x) __typeof((x).begin()) #define DIT(x) __typeof((x).rbegin()) #endif # inc\ lude # inc\ lude # inc\ lude # inc\ lude # inc\ lude # inc\ lude # inc\ lude # inc\ lude # inc\ lude # inc\ lude # inc\ lude # inc\ lude # inc\ lude # inc\ lude # inc\ lude # inc\ lude #define FAST_RW ios_base::sync_with_stdio(0),cin.tie(0); #define FS(i,a) for(ll i=0;a[i];i++) #define FE(it,x) for(IT(x) it=(x).begin(),_en=(x).end();it!=_en;it++) #define EF(it,x) for(DIT(x) it=(x).rbegin(),_en=(x).rend();it!=_en;it++) #define FR(i,en) for(ll i=0,_en=(en);i<_en;i++) #define FOR(i,en) for(ll i=1,_en=(en);i<=_en;i++) #define RF(i,en) for(ll i=(en)-1;i>=0;i--) #define ROF(i,en) for(ll i=(en);i>0;i--) #define FFR(i,x,y) for(ll i=(x),_en=(y);i<=_en;i++) #define RFF(i,x,y) for(ll i=(x),_en=(y);i>=_en;i--) #define ptf printf #define scf scanf #define pc putchar #define pb push_back #define ppb pop_back #define pq priority_queue #define fi first #define se second #define mp make_pair #define pii pair #define pll pair #define sqr(x) ((x)*(x)) #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define clr(x) memset((x),0,sizeof(x)) #define ms(x,v) memset((x),(v),sizeof(x)) #define mc(x,y) memcpy((x),(y),sizeof(y)) #define NL puts(""); #define LB lower_bound #define UB upper_bound #define rand() ((rand()<<16)^(rand()<<15)^(rand())) #ifdef _WIN32 #define _i64_ "%I\ 64d" #define _u64_ "%I\ 64u" #else #define _i64_ "%l\ ld" #define _u64_ "%l\ lu" #endif typedef unsigned ui; typedef long long ll; typedef unsigned long long ull; typedef long double lf; using namespace std; ll gcd(ll a,ll b){if(!b)return a;while(b^=a^=b^=a%=b);return a;} extern const ll MOD; ll ksm(ll a,ll b){ ll res=1;a%=MOD; for(;b;b>>=1){if(b&1)res=res*a%MOD;a=a*a%MOD;} return res; } #ifdef wmx16835 #include"wmx16835.h" #else #define LOG #define TEL #define test(...) 0 #define TEST(...) 0 #define DE if(0) #define AS(...) #define SF(...) #define SC #define PF #define PC #define PP #define SHOW_TIME #define BR #endif int main(){SHOW_TIME int __MAIN();__MAIN();} #define main __MAIN #define y0 NKwKGuBI #define y1 KFJssmlK #define yn XypGISMR #define j1 kQDCYYWX #define tm BdKIQNcs #define lr UsCPcJvt templatebool In(T1 x,T2 y,T3 z){return x<=y&&x>=z||x<=z&&x>=y;} templateT1 max(const T1&a,const T2&b){return aT1 max3(const T1&a,const T2&b,const T3&c){return aT1 min(const T1&a,const T2&b){return aT1 min3(const T1&a,const T2&b,const T3&c){return abool S(pair&a){return S(a.fi, a.se);} templatevoid S(T&a){a.in();} void _P(const int&x){ptf("%d",x);} void _P(const bool&x){ptf("%d",x);} void _P(const ui&x){ptf("%u",x);} void _P(const char&x){ptf("%c",x);} void _P(const char*x){ptf("%s",x);} void _P(const string&x){ptf("%s",x.c_str());} void _P(const ll&x){ptf(_i64_,x);} void _P(const ull&x){ptf(_u64_,x);} void _P(const float&x){ptf("%.*f",FLOAT_PRECISION,x);} void _P(const double&x){ptf("%.*f",FLOAT_PRECISION,x);} void _P(const lf&x){ptf("%.*f",FLOAT_PRECISION,(double)x);} templatevoid _P(const pair&x){_P(x.fi);pc(' ');_P(x.se);} templatevoid _P(const T&a){a.out();} templatebool S(T1&a,T2&b){return S(a)+S(b)==2;} templatebool S(T1&a,T2&b,T3&c){return S(a)+S(b)+S(c)==3;} templatebool S(T1&a,T2&b,T3&c,T4&d){return S(a)+S(b)+S(c)+S(d)==4;} templatebool S(T1&a,T2&b,T3&c,T4&d,T5&e){return S(a)+S(b)+S(c)+S(d)+S(e)==5;} templatevoid P(const T1&a){_P(a);pc(' ');} templatevoid P(const T1&a,const T2&b){_P(a);pc(' ');_P(b);pc(' ');} templatevoid PN(const T1&a){_P(a);NL} templatevoid PN(const T1&a,const T2&b){_P(a);pc(' ');_P(b);NL} templatevoid PN(const T1&a,const T2&b,const T3&c){_P(a);pc(' ');_P(b);pc(' ');_P(c);NL} templatevoid PN(const T1&a,const T2&b,const T3&c,const T4&d){_P(a);pc(' ');_P(b);pc(' ');_P(c);pc(' ');_P(d);NL} templatevoid PN(const T1&a,const T2&b,const T3&c,const T4&d,const T5&e){_P(a);pc(' ');_P(b);pc(' ');_P(c);pc(' ');_P(d);pc(' ');_P(e);NL} void PS(int a){ptf("%*s",a,"");} templatevoid SA(T*a,int n){FR(i,n)S(a[i]);} templatevoid PA(T*a,int n){FR(i,n){if(i)pc(' ');_P(a[i]);}NL} templatevoid PA(const T&x){FE(it,x){if(it!=x.begin())pc(' ');_P(*it);}NL} int kase; const double pi=acos(-1); const double ep=1e-9; const int INF=0x3f3f3f3f; const ll INFL=0x3f3f3f3f3f3f3f3fll; const ll MOD=1000000007; } char bf[1005]; struct Range { vector data; void Out() { FR(i, data.size()) PN(data[i]); BR } Range() { Init(-20000, 20000); } Range(int st, int en) { Init(st, en); } void Init(int st, int en) { data.pb(pii(st, en)); } Range(const char* op, int num) { if (!strcmp(op, ">")) Init(num + 1, 20000); else if (!strcmp(op, ">=")) Init(num, 20000); else if (!strcmp(op, "<")) Init(-20000, num - 1); else if (!strcmp(op, "<=")) Init(-20000, num); else if (!strcmp(op, "==")) Init(num, num); } Range operator + (const Range& r) const { Range res; res.data.clear(); for (int i = 0; i < data.size(); ++i) { for (int j = 0; j < r.data.size(); ++j) { pii cur(max(data[i].first, r.data[j].first), min(data[i].second, r.data[j].second)); if (cur.second >= cur.first) res.data.pb(cur); } } return res; } Range& operator += (const Range& r) { *this = *this + r; return *this; } }; char bf2[1005], op[10]; struct Cond { map mp; void In() { SL(bf); int i = 0; for (;;) { int num; sscanf(bf + i, "%s%s%d", bf2, op, &num); //PN(bf2, op, num); mp[bf2] += Range(op, num); //Range(op, num).Out(); while (bf[i] && bf[i] != ',') ++i; if (bf[i] == 0) break; ++i; } // FE(it, mp) { // PN(it->first); // it->second.Out(); // } } bool OK(Cond& r) { set fuhao; FE(i, mp) fuhao.insert(i->first); FE(i, r.mp) fuhao.insert(i->first); FE(i, fuhao) { if ((mp[*i] + r.mp[*i]).data.size() == 0) return false; } return true; } } cond[1005]; int main() { int n; S(n); FR(i, n) { cond[i].In(); vector res; FR(j, i) if (cond[i].OK(cond[j])) res.pb(j + 1); if (res.empty()) puts("unique"); else PA(res); } } /*********Risoft corporation all rights reserved*********/ /**************Template V2.35 build 20160222*************/