#include <bits/stdc++.h>
using namespace std;
const long long MAX_N = 3e5 + 7;
const long long MOD = 998244353;
long long n;
long long deg[MAX_N], fac[MAX_N];
long long f_pow(long long base, long long b, long long mod) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * base % mod;
    base = base * base % mod;
    b >>= 1;
  }
  return res;
}
namespace NTT {
const long long MAX_N = 3e6 + 7;
const long long MOD = 998244353;
const long long G = 3;
long long rev[MAX_N];
long long f[MAX_N], g[MAX_N];
long long n, m;
vector<vector<long long>> p;
struct Poly {
  long long n;
  vector<long long> p;
  Poly(vector<long long> _p = {}, long long _n = 0) : n(_n) {
    n = _p.size();
    p.resize(n);
    for (long long i = 0; i < n; ++i) p[i] = _p[i];
  }
  bool operator<(const Poly &a) const { return n > a.n; }
};
void ntt(long long *a, long long n, long long dft) {
  for (long long i = 0; i < n; i++) {
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  }
  for (long long i = 1; i < n; i <<= 1) {
    long long wn = f_pow(G, (MOD - 1) / (i << 1), MOD);
    if (dft < 0) wn = f_pow(wn, MOD - 2, MOD);
    for (long long j = 0; j < n; j += (i << 1)) {
      long long wnk = 1;
      for (long long k = j; k < j + i; k++) {
        long long a1 = a[k], a2 = wnk * a[k + i];
        a[k] = (a1 + a2 % MOD) % MOD;
        a[k + i] = (a1 - a2 % MOD) % MOD;
        wnk = wnk * wn % MOD;
      }
    }
  }
  if (dft == -1) {
    long long inv = f_pow(n, MOD - 2, MOD);
    for (long long i = 0; i < n; i++) a[i] = a[i] * inv % MOD;
  }
}
vector<long long> merge(const vector<long long> &F,
                        const vector<long long> &G) {
  n = F.size() - 1, m = G.size() - 1;
  long long N = 1, p = 0;
  while (N < (m + n + 1)) N <<= 1, ++p;
  for (long long i = 0; i < N; ++i) rev[i] = f[i] = g[i] = 0;
  for (long long i = 0; i < N; ++i)
    rev[i] = ((rev[i >> 1] >> 1) | ((i & 1) << (p - 1)));
  for (long long i = 0; i <= n; ++i) f[i] = F[i];
  for (long long i = 0; i <= m; ++i) g[i] = G[i];
  ntt(f, N, 1), ntt(g, N, 1);
  for (long long i = 0; i < N; ++i) f[i] = f[i] * g[i] % MOD;
  ntt(f, N, -1);
  vector<long long> res(m + n + 1);
  for (long long i = 0; i <= n + m; ++i) res[i] = (f[i] + MOD) % MOD;
  return res;
}
vector<long long> div_ntt(long long l, long long r) {
  if (l == r) return p[l];
  long long mid = (l + r) >> 1;
  vector<long long> F = div_ntt(l, mid), G = div_ntt(mid + 1, r);
  return merge(F, G);
}
vector<long long> solve() {
  priority_queue<Poly> q;
  for (long long i = 0; i < p.size(); ++i) q.push(Poly(p[i]));
  while (q.size() > 1) {
    vector<long long> F = q.top().p;
    q.pop();
    vector<long long> G = q.top().p;
    q.pop();
    q.push(Poly(merge(F, G)));
  }
  return q.top().p;
}
vector<long long> solve(long long l, long long r) { return div_ntt(l, r); }
}  // namespace NTT
signed main() {
  scanf("%lld", &n);
  for (long long i = 1; i < n; ++i) {
    long long x, y;
    scanf("%lld%lld", &x, &y);
    ++deg[x], ++deg[y];
  }
  for (long long i = 2; i <= n; ++i) --deg[i];
  for (long long i = 1; i <= n; ++i) {
    vector<long long> t;
    t.push_back(1ll);
    if (deg[i]) t.push_back(deg[i]);
    NTT::p.push_back(t);
  }
  vector<long long> F = NTT::solve();
  long long ans = 0, flag = 1;
  fac[0] = 1;
  for (long long i = 1; i <= n; ++i) fac[i] = fac[i - 1] * i % MOD;
  for (long long i = 0; i < n && i < F.size(); ++i) {
    ans = (ans + flag * F[i] * fac[n - i] % MOD) % MOD;
    flag = -flag;
  }
  printf("%lld\n", (ans + MOD) % MOD);
  return 0;
}

### Prompt

Please create a solution in Cpp to the following problem:

You are given a rooted tree consisting of n vertices numbered from 1 to n. The root of the tree is the vertex 1.

You have to color all vertices of the tree into n colors (also numbered from 1 to n) so that there is exactly one vertex for each color. Let c_i be the color of vertex i, and p_i be the parent of vertex i in the rooted tree. The coloring is considered beautiful if there is no vertex k (k > 1) such that c_k = c_{p_k} - 1, i. e. no vertex such that its color is less than the color of its parent by exactly 1.

Calculate the number of beautiful colorings, and print it modulo 998244353.

Input

The first line contains one integer n (2 ≤ n ≤ 250000) — the number of vertices in the tree.

Then n-1 lines follow, the i-th line contains two integers x_i and y_i (1 ≤ x_i, y_i ≤ n; x_i ≠ y_i) denoting an edge between the vertex x_i and the vertex y_i. These edges form a tree.

Output

Print one integer — the number of beautiful colorings, taken modulo 998244353.

Examples

Input


5
1 2
3 2
4 2
2 5


Output


42


Input


5
1 2
2 3
3 4
4 5


Output


53


Input


20
20 19
20 4
12 4
5 8
1 2
20 7
3 10
7 18
11 8
9 10
17 10
1 15
11 16
14 11
18 10
10 1
14 2
13 17
20 6


Output


955085064

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const long long MAX_N = 3e5 + 7;
const long long MOD = 998244353;
long long n;
long long deg[MAX_N], fac[MAX_N];
long long f_pow(long long base, long long b, long long mod) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * base % mod;
    base = base * base % mod;
    b >>= 1;
  }
  return res;
}
namespace NTT {
const long long MAX_N = 3e6 + 7;
const long long MOD = 998244353;
const long long G = 3;
long long rev[MAX_N];
long long f[MAX_N], g[MAX_N];
long long n, m;
vector<vector<long long>> p;
struct Poly {
  long long n;
  vector<long long> p;
  Poly(vector<long long> _p = {}, long long _n = 0) : n(_n) {
    n = _p.size();
    p.resize(n);
    for (long long i = 0; i < n; ++i) p[i] = _p[i];
  }
  bool operator<(const Poly &a) const { return n > a.n; }
};
void ntt(long long *a, long long n, long long dft) {
  for (long long i = 0; i < n; i++) {
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  }
  for (long long i = 1; i < n; i <<= 1) {
    long long wn = f_pow(G, (MOD - 1) / (i << 1), MOD);
    if (dft < 0) wn = f_pow(wn, MOD - 2, MOD);
    for (long long j = 0; j < n; j += (i << 1)) {
      long long wnk = 1;
      for (long long k = j; k < j + i; k++) {
        long long a1 = a[k], a2 = wnk * a[k + i];
        a[k] = (a1 + a2 % MOD) % MOD;
        a[k + i] = (a1 - a2 % MOD) % MOD;
        wnk = wnk * wn % MOD;
      }
    }
  }
  if (dft == -1) {
    long long inv = f_pow(n, MOD - 2, MOD);
    for (long long i = 0; i < n; i++) a[i] = a[i] * inv % MOD;
  }
}
vector<long long> merge(const vector<long long> &F,
                        const vector<long long> &G) {
  n = F.size() - 1, m = G.size() - 1;
  long long N = 1, p = 0;
  while (N < (m + n + 1)) N <<= 1, ++p;
  for (long long i = 0; i < N; ++i) rev[i] = f[i] = g[i] = 0;
  for (long long i = 0; i < N; ++i)
    rev[i] = ((rev[i >> 1] >> 1) | ((i & 1) << (p - 1)));
  for (long long i = 0; i <= n; ++i) f[i] = F[i];
  for (long long i = 0; i <= m; ++i) g[i] = G[i];
  ntt(f, N, 1), ntt(g, N, 1);
  for (long long i = 0; i < N; ++i) f[i] = f[i] * g[i] % MOD;
  ntt(f, N, -1);
  vector<long long> res(m + n + 1);
  for (long long i = 0; i <= n + m; ++i) res[i] = (f[i] + MOD) % MOD;
  return res;
}
vector<long long> div_ntt(long long l, long long r) {
  if (l == r) return p[l];
  long long mid = (l + r) >> 1;
  vector<long long> F = div_ntt(l, mid), G = div_ntt(mid + 1, r);
  return merge(F, G);
}
vector<long long> solve() {
  priority_queue<Poly> q;
  for (long long i = 0; i < p.size(); ++i) q.push(Poly(p[i]));
  while (q.size() > 1) {
    vector<long long> F = q.top().p;
    q.pop();
    vector<long long> G = q.top().p;
    q.pop();
    q.push(Poly(merge(F, G)));
  }
  return q.top().p;
}
vector<long long> solve(long long l, long long r) { return div_ntt(l, r); }
}  // namespace NTT
signed main() {
  scanf("%lld", &n);
  for (long long i = 1; i < n; ++i) {
    long long x, y;
    scanf("%lld%lld", &x, &y);
    ++deg[x], ++deg[y];
  }
  for (long long i = 2; i <= n; ++i) --deg[i];
  for (long long i = 1; i <= n; ++i) {
    vector<long long> t;
    t.push_back(1ll);
    if (deg[i]) t.push_back(deg[i]);
    NTT::p.push_back(t);
  }
  vector<long long> F = NTT::solve();
  long long ans = 0, flag = 1;
  fac[0] = 1;
  for (long long i = 1; i <= n; ++i) fac[i] = fac[i - 1] * i % MOD;
  for (long long i = 0; i < n && i < F.size(); ++i) {
    ans = (ans + flag * F[i] * fac[n - i] % MOD) % MOD;
    flag = -flag;
  }
  printf("%lld\n", (ans + MOD) % MOD);
  return 0;
}

```