#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = double;
using str = string;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vpi = vector<pair<int, int>>;
using vvi = vector<vi>;
int Bit(int mask, int b) { return (mask >> b) & 1; }
template <class T>
bool ckmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool ckmax(T &a, const T &b) {
  if (b > a) {
    a = b;
    return true;
  }
  return false;
}
const int maxN = 6e5;
vector<int> g[maxN];
const int md = 998244353;
int add(int a, int b) {
  if (a + b >= md) return a + b - md;
  return a + b;
}
int sub(int a, int b) {
  if (a - b < 0) return a - b + md;
  return a - b;
}
int mul(int a, int b) { return (1ll * a * b) % md; }
int binpow(int a, int b) {
  if (b <= 0) return 1;
  if (b % 2) return mul(a, binpow(a, b - 1));
  int m = binpow(a, b / 2);
  return mul(m, m);
}
int rev(int a) { return binpow(a, md - 2); }
int psq[maxN];
void init() {
  int s = 31;
  for (int i = (1 << 23); i >= 1; i /= 2, s = mul(s, s)) {
    if (i < maxN) psq[i] = s;
  }
}
void fft(vector<int> &s, vector<int> &res, int n, int x, int ss = 0,
         int step = 1, int rs = 0) {
  if (n == 1) {
    res[rs] = s[ss];
    return;
  }
  fft(s, res, n / 2, mul(x, x), ss, step * 2, rs);
  fft(s, res, n / 2, mul(x, x), ss + step, step * 2, rs + n / 2);
  int c = 1;
  for (int i = rs; i < rs + n / 2; ++i) {
    auto a = res[i], b = res[i + n / 2];
    res[i] = add(a, mul(b, c));
    res[i + n / 2] = sub(a, mul(b, c));
    c = mul(c, x);
  }
}
vector<int> multiply(vector<int> &a, vector<int> &b) {
  vector<int> as((a).begin(), (a).end()), bs((b).begin(), (b).end());
  int n = 1;
  while (n < a.size() || n < b.size()) n *= 2;
  n *= 2;
  as.resize(n);
  bs.resize(n);
  int t = psq[n];
  vector<int> resa(n), resb(n);
  fft(as, resa, n, t);
  fft(bs, resb, n, t);
  for (int i = 0; i < (n); ++i) resa[i] = mul(resa[i], resb[i]);
  t = rev(t);
  fft(resa, as, n, t);
  int rn = rev(n);
  for (int i = 0; i < (n); ++i) as[i] = mul(as[i], rn);
  return as;
}
vector<int> have;
void dfs(int v, int p) {
  have.push_back((int)g[v].size());
  if (p != -1) have.back()--;
  if (have.back() == 0) have.pop_back();
  for (auto &u : g[v]) {
    if (u == p) continue;
    dfs(u, v);
  }
}
void solve() {
  init();
  int n;
  cin >> n;
  for (int _ = 0; _ < (n - 1); ++_) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1, -1);
  function<vector<int>(int, int)> solve = [&](int l, int r) {
    if (l + 1 == r) {
      return vector<int>{1, have[l]};
    }
    auto L = solve(l, (l + r) / 2);
    auto R = solve((l + r) / 2, r);
    auto M = multiply(L, R);
    while (!M.empty() && M.back() == 0) M.pop_back();
    return M;
  };
  auto res = solve(0, (int)have.size());
  int f = 1;
  for (int i = 1; i < n; ++i) f = mul(f, i);
  int ans = mul(f, n);
  for (int i = 1; i < (int)res.size(); ++i) {
    if (i % 2 == 0) {
      ans = add(ans, mul(f, res[i]));
    } else {
      ans = sub(ans, mul(f, res[i]));
    }
    f = mul(f, rev(n - i));
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  for (int _ = 0; _ < (t); ++_) {
    solve();
  }
  return 0;
}

### Prompt

Your task is to create a Cpp solution 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;
using ll = long long;
using ld = double;
using str = string;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vpi = vector<pair<int, int>>;
using vvi = vector<vi>;
int Bit(int mask, int b) { return (mask >> b) & 1; }
template <class T>
bool ckmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool ckmax(T &a, const T &b) {
  if (b > a) {
    a = b;
    return true;
  }
  return false;
}
const int maxN = 6e5;
vector<int> g[maxN];
const int md = 998244353;
int add(int a, int b) {
  if (a + b >= md) return a + b - md;
  return a + b;
}
int sub(int a, int b) {
  if (a - b < 0) return a - b + md;
  return a - b;
}
int mul(int a, int b) { return (1ll * a * b) % md; }
int binpow(int a, int b) {
  if (b <= 0) return 1;
  if (b % 2) return mul(a, binpow(a, b - 1));
  int m = binpow(a, b / 2);
  return mul(m, m);
}
int rev(int a) { return binpow(a, md - 2); }
int psq[maxN];
void init() {
  int s = 31;
  for (int i = (1 << 23); i >= 1; i /= 2, s = mul(s, s)) {
    if (i < maxN) psq[i] = s;
  }
}
void fft(vector<int> &s, vector<int> &res, int n, int x, int ss = 0,
         int step = 1, int rs = 0) {
  if (n == 1) {
    res[rs] = s[ss];
    return;
  }
  fft(s, res, n / 2, mul(x, x), ss, step * 2, rs);
  fft(s, res, n / 2, mul(x, x), ss + step, step * 2, rs + n / 2);
  int c = 1;
  for (int i = rs; i < rs + n / 2; ++i) {
    auto a = res[i], b = res[i + n / 2];
    res[i] = add(a, mul(b, c));
    res[i + n / 2] = sub(a, mul(b, c));
    c = mul(c, x);
  }
}
vector<int> multiply(vector<int> &a, vector<int> &b) {
  vector<int> as((a).begin(), (a).end()), bs((b).begin(), (b).end());
  int n = 1;
  while (n < a.size() || n < b.size()) n *= 2;
  n *= 2;
  as.resize(n);
  bs.resize(n);
  int t = psq[n];
  vector<int> resa(n), resb(n);
  fft(as, resa, n, t);
  fft(bs, resb, n, t);
  for (int i = 0; i < (n); ++i) resa[i] = mul(resa[i], resb[i]);
  t = rev(t);
  fft(resa, as, n, t);
  int rn = rev(n);
  for (int i = 0; i < (n); ++i) as[i] = mul(as[i], rn);
  return as;
}
vector<int> have;
void dfs(int v, int p) {
  have.push_back((int)g[v].size());
  if (p != -1) have.back()--;
  if (have.back() == 0) have.pop_back();
  for (auto &u : g[v]) {
    if (u == p) continue;
    dfs(u, v);
  }
}
void solve() {
  init();
  int n;
  cin >> n;
  for (int _ = 0; _ < (n - 1); ++_) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1, -1);
  function<vector<int>(int, int)> solve = [&](int l, int r) {
    if (l + 1 == r) {
      return vector<int>{1, have[l]};
    }
    auto L = solve(l, (l + r) / 2);
    auto R = solve((l + r) / 2, r);
    auto M = multiply(L, R);
    while (!M.empty() && M.back() == 0) M.pop_back();
    return M;
  };
  auto res = solve(0, (int)have.size());
  int f = 1;
  for (int i = 1; i < n; ++i) f = mul(f, i);
  int ans = mul(f, n);
  for (int i = 1; i < (int)res.size(); ++i) {
    if (i % 2 == 0) {
      ans = add(ans, mul(f, res[i]));
    } else {
      ans = sub(ans, mul(f, res[i]));
    }
    f = mul(f, rev(n - i));
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  for (int _ = 0; _ < (t); ++_) {
    solve();
  }
  return 0;
}

```