#include <bits/stdc++.h>
using namespace std;
#define n_l '\n'
#define dbg(...) cout << "[" << #__VA_ARGS__ << "]: "; cout << to_string(__VA_ARGS__) << endl
template <typename T, size_t N> int SIZE(const T (&t)[N]){ return N; } template<typename T> int SIZE(const T &t){ return t.size(); } string to_string(const string s, int x1=0, int x2=1e9){ return '"' + ((x1 < s.size()) ? s.substr(x1, x2-x1+1) : "") + '"'; } string to_string(const char* s) { return to_string((string) s); } string to_string(const bool b) { return (b ? "true" : "false"); } string to_string(const char c){ return string({c}); } template<size_t N> string to_string(const bitset<N> &b, int x1=0, int x2=1e9){ string t = ""; for(int __iii__ = min(x1,SIZE(b)), __jjj__ = min(x2, SIZE(b)-1); __iii__ <= __jjj__; ++__iii__){ t += b[__iii__] + '0'; } return '"' + t + '"'; } template <typename A, typename... C> string to_string(const A (&v), int x1=0, int x2=1e9, C... coords); int l_v_l_v_l = 0, t_a_b_s = 0; template <typename A, typename B> string to_string(const pair<A, B> &p) { l_v_l_v_l++; string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; l_v_l_v_l--; return res; } template <typename A, typename... C> string to_string(const A (&v), int x1, int x2, C... coords) { int rnk = rank<A>::value; string tab(t_a_b_s, ' '); string res = ""; bool first = true; if(l_v_l_v_l == 0) res += n_l; res += tab + "["; x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v)); auto l = begin(v); advance(l, x1); auto r = l; advance(r, (x2-x1) + (x2 < SIZE(v))); for (auto e = l; e != r; e = next(e)) { if (!first) { res += ", "; } first = false; l_v_l_v_l++; if(e != l){ if(rnk > 1) { res += n_l; t_a_b_s = l_v_l_v_l; }; } else{ t_a_b_s = 0; } res += to_string(*e, coords...); l_v_l_v_l--; } res += "]"; if(l_v_l_v_l == 0) res += n_l; return res; } void dbgm(){;} template<typename Heads, typename... Tails> void dbgm(Heads H, Tails... T){ cout << to_string(H) << " | "; dbgm(T...); }
#define dbgm(...) cout << "[" << #__VA_ARGS__ << "]: "; dbgm(__VA_ARGS__); cout << endl
/*expanded version*/
/*
template <typename T, size_t N>
int SIZE(const T (&t)[N]){
return N;
}
template<typename T>
int SIZE(const T &t){
return t.size();
}
string to_string(const string s, int x1=0, int x2=1e9){
return '"' + ((x1 < s.size()) ? s.substr(x1, x2-x1+1) : "") + '"';
}
string to_string(const char* s) {
return to_string((string) s);
}
string to_string(const bool b) {
return (b ? "true" : "false");
}
string to_string(const char c){
return string({c});
}
template<size_t N>
string to_string(const bitset<N> &b, int x1=0, int x2=1e9){
string t = "";
for(int __iii__ = min(x1,SIZE(b)), __jjj__ = min(x2, SIZE(b)-1); __iii__ <= __jjj__; ++__iii__){
t += b[__iii__] + '0';
}
return '"' + t + '"';
}
template <typename A, typename... C>
string to_string(const A (&v), int x1=0, int x2=1e9, C... coords);
int l_v_l_v_l = 0, t_a_b_s = 0;
template <typename A, typename B>
string to_string(const pair<A, B> &p) {
l_v_l_v_l++;
string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
l_v_l_v_l--;
return res;
}
template <typename A, typename... C>
string to_string(const A (&v), int x1, int x2, C... coords) {
int rnk = rank<A>::value;
string tab(t_a_b_s, ' ');
string res = "";
bool first = true;
if(l_v_l_v_l == 0) res += n_l;
res += tab + "[";
x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v));
auto l = begin(v);
advance(l, x1);
auto r = l;
advance(r, (x2-x1) + (x2 < SIZE(v)));
for (auto e = l; e != r; e = next(e)) {
if (!first) {
res += ", ";
}
first = false;
l_v_l_v_l++;
if(e != l){
if(rnk > 1) {
res += n_l;
t_a_b_s = l_v_l_v_l;
};
}
else{
t_a_b_s = 0;
}
res += to_string(*e, coords...);
l_v_l_v_l--;
}
res += "]";
if(l_v_l_v_l == 0) res += n_l;
return res;
}
void dbgm(){;}
template<typename Heads, typename... Tails>
void dbgm(Heads H, Tails... T){
cout << to_string(H) << " | ";
dbgm(T...);
}
#define dbgm(...) cout << "[" << #__VA_ARGS__ << "]: "; dbgm(__VA_ARGS__); cout << endl;
//*/
/*end of expanded version*/
int main(){
/*..tests..*/
int j[2][2][3] = {{{4,5,6},{10,11,12}}, {{1,2,3}, {7,8,9}}};
dbg(j);
dbg(j,0,0,0,1,0,1);
map<vector<int>, vector<string>> a = {{{3,4},{"sauron"}}, {{1,2},{"gandalf", "the", "grey"}}, {{5},{"frodo","bilbo"}}};
dbg(a);
dbg(a,0,1);
dbg(a,5,5);
set<vector<string>> b[3] = {{{"abc", "def"},{"ghi"}}, {{"klm","nop"},{"qrs"}}, {{"tuv", "wxy", "zab"}}};
dbg(b,1,2,0,0,0,0,1,2);
dbg(b,1,2,0,0,0,0);
dbg(b,1,2,0,0);
dbg(b,1,2);
dbg(b);
map<int, map<int,int>> c = {{1,{{2,3}}},{4,{{5,6},{7,8}}},{9,{{10,11}}}};
dbg(c,0,0);
dbg(c);
vector<bitset<10>> q = {{12},{13},{14},{15}};
dbg(q);
dbg(q,1,2,0,2);
dbg(q,5,5,0,2);
for(int i = 0; i < 2; ++i) {
dbgm(q[i]);
}
pair<int, set<int>> m = {1, {2,3,3,3,4}};
dbg(m);
deque<int> i = {9,10,11,12};
dbg(i);
dbg(i,2,3);
set<pair<int, int>> x{{1,2},{3,4}};
dbg(x,1,1);
dbg(x);
string s = {"codeforces"};
dbg(s,20,1);
dbg(s,1,4);
int t = 5; char u = 'R';
pair<pair<double, unsigned int>, pair<int, string>> v = {{234.34534, 42}, {133, "IOI"}};
dbgm(s,t,u,v);
dbgm(5.345,7,12);
/*
vector<vector<string>> d = {{"how", "r"}, {"u"}};
dbg(d);
dbg(d,0,1,0,0,0,1);
vector<string> e = {"fated", "faithful", "fatal"};
dbg(e);
dbg(e,0,2,3,4);
char f[][5] = {{'t','r','i', 'c', 'k'},{'f','r','e','e'}};
dbg(f);
dbg(f,0,10,1,3);
string g[2][2] = {{"file", "input"}, {"file", "output"}};
dbg(g);
dbg(g,0,1,0,1,0,1);
vector<long long> h = {1,2,3,4,5};
dbg(h);
dbg(h,2,3);
vector<int> k[2][2] = {{{1,2,3}, {4,5}},{{6,7,8}, {9,10}}};
dbg(k);
dbg(k,0,1,0,3,0,0);
map<int, pair<int, int>> l = {{1,{2,3}}, {4,{5,6}}, {7,{8,9}}};
dbg(l);
dbg(l,0,1);
vector<double> n{3.14159265359, 2.71828};
dbg(n,0);
vector<unsigned long long> o{2934872934792347, 834759385742};
dbg(o,0);
bitset<8> p[][1] = {20,21,22,23,20,21,22,23};
dbg(p);
dbg(p,1,3);
bitset<6> r(25);
dbg(r);
dbg(r,0,4);
dbg(r,20,1);
*/
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIG5fbCAnXG4nCiNkZWZpbmUgZGJnKC4uLikgY291dCA8PCAiWyIgPDwgI19fVkFfQVJHU19fIDw8ICJdOiAiOyBjb3V0IDw8IHRvX3N0cmluZyhfX1ZBX0FSR1NfXykgPDwgZW5kbAp0ZW1wbGF0ZSA8dHlwZW5hbWUgVCwgc2l6ZV90IE4+IGludCBTSVpFKGNvbnN0IFQgKCZ0KVtOXSl7IHJldHVybiBOOyB9IHRlbXBsYXRlPHR5cGVuYW1lIFQ+IGludCBTSVpFKGNvbnN0IFQgJnQpeyByZXR1cm4gdC5zaXplKCk7IH0gc3RyaW5nIHRvX3N0cmluZyhjb25zdCBzdHJpbmcgcywgaW50IHgxPTAsIGludCB4Mj0xZTkpeyByZXR1cm4gJyInICsgKCh4MSA8IHMuc2l6ZSgpKSA/IHMuc3Vic3RyKHgxLCB4Mi14MSsxKSA6ICIiKSArICciJzsgfSBzdHJpbmcgdG9fc3RyaW5nKGNvbnN0IGNoYXIqIHMpIHsgcmV0dXJuIHRvX3N0cmluZygoc3RyaW5nKSBzKTsgfSBzdHJpbmcgdG9fc3RyaW5nKGNvbnN0IGJvb2wgYikgeyByZXR1cm4gKGIgPyAidHJ1ZSIgOiAiZmFsc2UiKTsgfSBzdHJpbmcgdG9fc3RyaW5nKGNvbnN0IGNoYXIgYyl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I8QSwgQj4gJnApIHsKICAgICBsX3ZfbF92X2wrKzsKICAgICBzdHJpbmcgcmVzID0gIigiICsgdG9fc3RyaW5nKHAuZmlyc3QpICsgIiwgIiArIHRvX3N0cmluZyhwLnNlY29uZCkgKyAiKSI7CiAgICAgbF92X2xfdl9sLS07CiAgICAgcmV0dXJuIHJlczsKIH0KCiB0ZW1wbGF0ZSA8dHlwZW5hbWUgQSwgdHlwZW5hbWUuLi4gQz4KIHN0cmluZyB0b19zdHJpbmcoY29uc3QgQSAoJnYpLCBpbnQgeDEsIGludCB4MiwgQy4uLiBjb29yZHMpIHsKCiAgICAgaW50IHJuayA9IHJhbms8QT46OnZhbHVlOwogICAgIHN0cmluZyB0YWIodF9hX2JfcywgJyAnKTsKCiAgICAgc3RyaW5nIHJlcyA9ICIiOwogICAgIGJvb2wgZmlyc3QgPSB0cnVlOwoKICAgICBpZihsX3ZfbF92X2wgPT0gMCkgcmVzICs9IG5fbDsKICAgICByZXMgKz0gdGFiICsgIlsiOwoKICAgICB4MSA9IG1pbih4MSwgU0laRSh2KSksIHgyID0gbWluKHgyLCBTSVpFKHYpKTsKICAgICBhdXRvIGwgPSBiZWdpbih2KTsKICAgICBhZHZhbmNlKGwsIHgxKTsKICAgICBhdXRvIHIgPSBsOwogICAgIGFkdmFuY2UociwgKHgyLXgxKSArICh4MiA8IFNJWkUodikpKTsKCiAgICAgZm9yIChhdXRvIGUgPSBsOyBlICE9IHI7IGUgPSBuZXh0KGUpKSB7CiAgICAgICAgIGlmICghZmlyc3QpIHsKICAgICAgICAgICAgIHJlcyArPSAiLCAiOwogICAgICAgICB9CiAgICAgICAgIGZpcnN0ID0gZmFsc2U7CgogICAgICAgICBsX3ZfbF92X2wrKzsKICAgICAgICAgaWYoZSAhPSBsKXsKICAgICAgICAgICAgIGlmKHJuayA+IDEpIHsKICAgICAgICAgICAgICAgICByZXMgKz0gbl9sOwogICAgICAgICAgICAgICAgIHRfYV9iX3MgPSBsX3ZfbF92X2w7CiAgIC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