#include using namespace std; using Int=long long; using Real=long double; templateinline bool chmin(T&A,S B){if(A>B){A=B;return true;}else{return false;}} templateinline bool chmax(T&A,S B){if(A>S; Y=stoi(S.substr(0,4)),M=stoi(S.substr(5,2)),D=stoi(S.substr(8,2)); int A[]={31,(Y%4==0)^(Y%100==0)^(Y%400==0)?29:28,31,30,31,30,31,31,30,31,30,31}; D+=2; if(D>A[M-1]) { D-=A[M-1]; if(++M>12)++Y,M=1; } string a=to_string(Y),b=to_string(M),c=to_string(D); if(b.size()<2)b="0"+b; if(c.size()<2)c="0"+c; cout<>T; while(T--)sol(); }