#include using namespace std; using ch = char; using ll = long long; using ld = long double; using db = double; using st = string; using vdb = vector; using vvdb = vector; using vl = vector; using vvl = vector; using vvvl = vector; using vd = vector; using vvd = vector; using vs = vector; using vvs = vector; using vc = vector; using vvc = vector; using vb = vector; using vvb = vector; using vvvb = vector; const ll mod = 998244353; const ll MOD = 1000000007; const ll INF = 1000000000000000000LL; using pall = pair; using vp = vector; void fix(){ cout< struct RMQ { const T e = numeric_limits::max(); function fx = [](T x1, T x2) -> T { return min(x1,x2); }; ll n; vector dat; RMQ(ll n_) : n(), dat(n_ * 4, e) { ll x = 1; while (n_ > x) { x *= 2; } n = x; } void set(ll i, T x) { dat[i + n - 1] = x; } void build() { for (ll k = n - 2; k >= 0; k--) dat[k] = fx(dat[2 * k + 1], dat[2 * k + 2]); } void update(ll i, T x) { i += n - 1; dat[i] = x; while (i > 0) { i = (i - 1) / 2; // parent dat[i] = fx(dat[i * 2 + 1], dat[i * 2 + 2]); } } // the minimum element of [a,b) T query(ll a, ll b) { return query_sub(a, b, 0, 0, n); } T query_sub(ll a, ll b, ll k, ll l, ll r) { if (r <= a || b <= l) { return e; } else if (a <= l && r <= b) { return dat[k]; } else { T nl = query_sub(a, b, k * 2 + 1, l, (l + r) / 2); T nr = query_sub(a, b, k * 2 + 2, (l + r) / 2, r); return fx(nl, nr); } } ll find_rightest(ll a, ll b, T x) { return find_rightest_sub(a, b, x, 0, 0, n); } ll find_leftest(ll a, ll b, T x) { return find_leftest_sub(a, b, x, 0, 0, n); } ll find_rightest_sub(ll a, ll b, T x, ll k, ll l, ll r) { if (dat[k] > x || r <= a || b <= l) { // 自分の値がxより大きい or [a,b)が[l,r)の範囲外ならreturn a-1 return a - 1; } else if (k >= n - 1) { // 自分が葉ならその位置をreturn return (k - (n - 1)); } else { int nr = find_rightest_sub(a, b, x, 2 * k + 2, (l + r) / 2, r); if (nr != a - 1) { // 右の部分木を見て a-1 以外ならreturn return nr; } else { // 左の部分木を見て値をreturn return find_rightest_sub(a, b, x, 2 * k + 1, l, (l + r) / 2); } } } ll find_leftest_sub(ll a, ll b, T x, ll k, ll l, ll r) { if (dat[k] > x || r <= a || b <= l) { // 自分の値がxより大きい or [a,b)が[l,r)の範囲外ならreturn b return b; } else if (k >= n - 1) { // 自分が葉ならその位置をreturn return (k - (n - 1)); } else { ll nl = find_leftest_sub(a, b, x, 2 * k + 1, l, (l + r) / 2); if (nl != b) { // 左の部分木を見て b 以外ならreturn return nl; } else { // 右の部分木を見て値をreturn return find_leftest_sub(a, b, x, 2 * k + 2, (l + r) / 2, r); } } } }; ll modpow(ll a, ll n, ll m) { ll res = 1; while (n > 0) { if (n & 1) res = res * a % m; a = a * a % m; n >>= 1; } return res; } ll modinv(ll a, ll b, ll m) { // a/bを返す return modpow(b, m - 2, m) * a % m; } vl zaatu(vl A){ //0はじまり vl B=A; sort(B.begin(), B.end()); B.erase(unique(B.begin(), B.end()), B.end()); vl R(A.size()); ll asize=A.size(); for(int i=0; i c(A,B); return c(b); } ll mypow(ll a, ll n){ ll ans=1; for(int i=0; i 0) { res += n%10; n /= 10; } return res; } int main(){ ll N,M; cin>>N>>M; if(N