#include #include using namespace std; namespace my{ #define ST(...) string __VA_ARGS__;lin(__VA_ARGS__) #define FO(n) for(ll ij=n;ij-->0;) #define FOR(i,...) for(auto[i,i##stop,i##step]=range(0,__VA_ARGS__);isync_with_stdio(0);cout<r{0,0,1};ll I=0;((r[I++]=a),...);if(!s&&I==1)swap(r[0],r[1]);r[0]-=s;if(s)r[2]*=-1;return r;} constexpr char newline=10; constexpr char space=32; constexpr auto schrodinger(bool p,char c){return string(p,c);} templateauto pack_kth(const auto&...a){return get(make_tuple(a...));} templateauto pack_slice(const auto&...a){return[&](index_sequence){return array{get(forward_as_tuple(a...))...};}(make_index_sequence{});} templateconcept vectorial=is_base_of_v,V>; templateistream&operator>>(istream&i,vector&v){fe(v,e)i>>e;return i;} templateostream&operator<<(ostream&o,const vector&v){fe(v,e)o<?newline:space);return o;} templatestruct vec; templatestruct tensor_helper{using type=vec::type>;}; templatestruct tensor_helper<0,T>{using type=T;}; templateusing tensor=typename tensor_helper::type; templatestruct vec:vector{ using vector::vector; vec(const vector&v){vector::operator=(v);} templaterequires(sizeof...(A)>=3)vec(A...a){const ll n=sizeof...(a)-1;auto t=pack_slice(a...);ll s[n];fo(i,n)s[i]=t[i];*this=make_vec(s,pack_kth(a...));} templatestatic auto make_vec(const ll(&s)[n],T x){if constexpr(i==n-1)return vec(s[i],x);else{auto X=make_vec(s,x);return vec(s[i],X);}} vec&operator^=(const vec&u){this->insert(this->end(),u.begin(),u.end());return*this;} vec operator^(const vec&u)const{return vec{*this}^=u;} vec&operator+=(const vec&u){vec&v=*this;assert(v.size()==u.size());fo(i,v.size())v[i]+=u[i];return v;} vec&operator-=(const vec&u){vec&v=*this;assert(v.size()==u.size());fo(i,v.size())v[i]-=u[i];return v;} vec operator+(const vec&u)const{return vec{*this}+=u;} vec operator-(const vec&u)const{return vec{*this}-=u;} vec&operator++(){fe(*this,e)++e;return*this;} vec&operator--(){fe(*this,e)--e;return*this;} vec operator-()const{vec v=*this;fe(v,e)e=-e;return v;} vec&operator%=(auto M){vec&v=*this;fe(v,e)e%=M;return v;} vec operator%(auto M)const{return vec{*this}%=M;} ll size()const{return vector::size();} }; templaterequires(sizeof...(A)>=2)vec(A...a)->vec(declval>()))>>>; vec(ll)->vec; void lin(auto&...a){(cin>>...>>a);} templatestruct pow_linear:vec{pow_linear(ll a,ll n):vec(n+1,1){fo(i,n)(*this)[i+1]=(*this)[i]*a;}}; ll pow2ll(ll n){static const auto v=pow_linear(2,bit_sizeof(ll)-1);return v[n];} struct string:std::string{ using std::string::string; string(const std::string&s):std::string(s){} auto&operator*=(ll t){auto x=*this;fo(t-1)*this+=x;return*this;} auto operator*(ll t)const{return string{*this}*=t;} }; void pp(auto&&...a){ll n=sizeof...(a);((cout<0,space)),...);cout<