C++namespace IO {
constexpr int S = (1 << 18);
int digital = 2;
bool is_round = 1;
char b[S], *m = b, *n = b, g[S], *p = g;
inline void f() { fwrite(g, 1, p - g, stdout), p = g; }
struct R {
inline bool w(char c) { return 47 < c && c < 58; }
inline bool y(char c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t'; }
inline char i() { if (m == n) n = (m = b) + fread(b, 1, S, stdin); return m == n ? ' ' : *m++; }
template <class T> inline R &operator>>(T &x) { char c = i(); T f = 1; for (x = 0; !w(c);) { if(c == '-') f = -1; c = i(); } while (w(c)) x *= 10, x += c ^ 48, c = i(); x *= f; return *this; }
inline R &operator>>(char *s) { int l = 0; char c; operator>>(c); for (; !y(c); s[l++] = c, c = i()) ; s[l] = '\0'; return *this; }
inline R &operator>>(string &s) { s = ""; char c = i(); while(y(c)) c = i(); while(!y(c)) s += c, c = i(); return *this; }
inline R &operator>>(double &x) { double t = 1, s = 0; char c = i(); for (x = 0; !w(c); c = i()) s = (c == '-'); for (; w(c); c = i()) x = x * 10 + c - 48; if (c == '.') for (c = i(); w(c); c = i()) x += (t /= 10.0) * (c - 48), s && (x = -x); return *this; }
inline R &operator>>(char &c) { do c = i(); while (y(c)); return *this; }
template<class T> void tie(T x) {}
} cin;
#define endl '\n'
struct W {
inline void o(char c) { *p++ = c; if (p - g == S) f(); }
template <class T> inline W &operator<<(T x) { if (!x) return o(48), *this; if(x < 0) o('-'), x = -x; static int s[64], t = 0; while (x) s[++t] = x % 10, x /= 10; while (t) o(s[t--] + 48); return *this; }
inline W &operator<<(char c) { o(c); return *this; }
template <class T> inline W &operator<<(T *s) { int c = 0; while (s[c]) o(s[c++]); return *this; }
inline W &operator<<(double x) { int k = 0; if(x < 0) o('-'), x = -x; if(is_round) x += 5 * pow(10, -digital - 1); operator<<((int)x), o('.'), x -= (int)x; while (k++ < digital) o((int)(x *= 10) + 48), x -= (int)x; return *this; }
inline W &operator<<(string s) { for(int i = 0; s[i] ^ '\0'; ++i) o(s[i]); return *this; }
template<class T> void tie(T x) {}
~W() { f(); }
} cout;
struct E { template <class T> E &operator<<(T x) { return *this; } } cerr;
} ;
#define cin IO::cin
#define cout IO::cout
// #define cerr IO::cerr