#include #include #include using namespace std; namespace mod{ typedef long long LL; typedef vector VLL; typedef vector VVLL; const int MOD=(int)(1e9+7); // aとbの最大公約数 // O(log (a+b) ) LL gcd(LL a,LL b){ return (b==0)?a:gcd(b,a%b); } // aとbの最小公倍数 // O(log (a+b) ) LL lcm(LL a,LL b){ return (a*b)/gcd(a,b); } // a x + b y = gcd(a, b) // O(log (a+b) ) LL extgcd(LL a, LL b, LL &x, LL &y) { LL g = a; x = 1; y = 0; if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x; return g; } // mを法とするaの逆元 // O(log a) LL invMod(LL a) { LL x, y; if (extgcd(a, MOD, x, y) == 1) return (x + MOD) % MOD; else return 0; // unsolvable } // iCjの組み合わせを全列挙してvectorに格納 // (0<=j<=i<=n) // O(n^2) VVLL init_comb(int n){ n++; VVLL res(n,VLL(n,0)); for(int i=0;i>T; while(T--){ string s; cin>>s; char c=s[0]; int i=2; mod::LL n=0; for(;s[i]!=',';i++){ n*=10; n+=(s[i]-'0'); } i++; int k=0; for(;s[i]!=')';i++){ k*=10; k+=(s[i]-'0'); } if(n==0&&k==0){ cout<<1<n)cout<<0<n)cout<<0<