#include <bits/stdc++.h>
using namespace std;
void main0();
int main() {
  clock_t start, end;
  ios::sync_with_stdio(false);
  cin.tie(0);
  main0();
  return 0;
}
const int dx[8] = {0, 1, -1, 0, 1, 1, -1, -1};
const int dy[8] = {1, 0, 0, -1, 1, -1, -1, 1};
const int N = 5e5 + 5;
const int M = 1e5;
const int INF = 0x3f3f3f3f;
const long long INFF = 0x3f3f3f3f3f3f3f3f;
const int mod = 998244353;
const int G = 3;
const int Gi = 332748118;
const double eps = 1e-6;
mt19937 rnd(
    (unsigned int)chrono::steady_clock::now().time_since_epoch().count());
template <typename T>
bool chkmin(T &x, T y) {
  return y < x ? x = y, 1 : 0;
}
template <typename T>
bool chkmax(T &x, T y) {
  return y > x ? x = y, 1 : 0;
}
long long qpow(long long n, long long m) {
  long long ret = 1;
  while (m) {
    if (m & 1) ret = ret * n % mod;
    n = n * n % mod;
    m >>= 1;
  }
  return ret;
}
long long getinv(long long a) { return qpow(a, mod - 2); }
int n;
vector<int> e[N];
long long fac[N];
void init() {
  fac[0] = 1;
  for (int i = 1; i <= N - 1; ++i) {
    fac[i] = fac[i - 1] * i % mod;
  }
}
int r[N], lim;
void ntt(vector<long long> &A, int type) {
  for (int i = 0; i <= lim - 1; ++i) {
    if (i < r[i]) swap(A[i], A[r[i]]);
  }
  for (int mid = 1; mid <= lim - 1; mid <<= 1) {
    long long Wn = qpow(type == 1 ? G : Gi, (mod - 1) / (mid << 1));
    for (int j = 0; j <= lim - 1; j += (mid << 1)) {
      long long w = 1;
      for (int k = 0; k <= mid - 1; ++k, w = (w * Wn) % mod) {
        int x = A[j + k];
        int y = w * A[j + mid + k] % mod;
        A[j + k] = (x + y) % mod;
        A[j + mid + k] = (x - y + mod) % mod;
      }
    }
  }
  if (type == -1) {
    long long tmp = getinv(lim);
    for (int i = 0; i <= lim - 1; ++i) {
      A[i] = A[i] * tmp % mod;
    }
  }
}
vector<long long> operator*(vector<long long> A, vector<long long> B) {
  int len = A.size() + B.size() - 1;
  lim = 1;
  while (lim <= len) lim <<= 1;
  for (int i = 0; i <= lim - 1; ++i) {
    r[i] = (r[i >> 1] >> 1) | ((i & 1) * (lim >> 1));
  }
  A.resize(lim);
  B.resize(lim);
  ntt(A, 1);
  ntt(B, 1);
  for (int i = 0; i <= lim - 1; ++i) {
    A[i] = A[i] * B[i] % mod;
  }
  ntt(A, -1);
  A.resize(len);
  return A;
}
vector<long long> solve(int l, int r) {
  if (l == r) {
    vector<long long> tmp({1, (int)e[l].size() - (l != 1)});
    return tmp;
  }
  int mid = (l + r) / 2;
  return solve(l, mid) * solve(mid + 1, r);
}
void main0() {
  init();
  cin >> n;
  for (int i = 1; i <= n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  vector<long long> v = solve(1, n);
  long long ans = 0;
  for (int i = 0; i <= n - 1; ++i) {
    ans += (i & 1 ? -1 : 1) * v[i] * fac[n - i] % mod;
    ans %= mod;
  }
  ans += mod;
  ans %= mod;
  cout << ans << endl;
}

### Prompt

Generate 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;
void main0();
int main() {
  clock_t start, end;
  ios::sync_with_stdio(false);
  cin.tie(0);
  main0();
  return 0;
}
const int dx[8] = {0, 1, -1, 0, 1, 1, -1, -1};
const int dy[8] = {1, 0, 0, -1, 1, -1, -1, 1};
const int N = 5e5 + 5;
const int M = 1e5;
const int INF = 0x3f3f3f3f;
const long long INFF = 0x3f3f3f3f3f3f3f3f;
const int mod = 998244353;
const int G = 3;
const int Gi = 332748118;
const double eps = 1e-6;
mt19937 rnd(
    (unsigned int)chrono::steady_clock::now().time_since_epoch().count());
template <typename T>
bool chkmin(T &x, T y) {
  return y < x ? x = y, 1 : 0;
}
template <typename T>
bool chkmax(T &x, T y) {
  return y > x ? x = y, 1 : 0;
}
long long qpow(long long n, long long m) {
  long long ret = 1;
  while (m) {
    if (m & 1) ret = ret * n % mod;
    n = n * n % mod;
    m >>= 1;
  }
  return ret;
}
long long getinv(long long a) { return qpow(a, mod - 2); }
int n;
vector<int> e[N];
long long fac[N];
void init() {
  fac[0] = 1;
  for (int i = 1; i <= N - 1; ++i) {
    fac[i] = fac[i - 1] * i % mod;
  }
}
int r[N], lim;
void ntt(vector<long long> &A, int type) {
  for (int i = 0; i <= lim - 1; ++i) {
    if (i < r[i]) swap(A[i], A[r[i]]);
  }
  for (int mid = 1; mid <= lim - 1; mid <<= 1) {
    long long Wn = qpow(type == 1 ? G : Gi, (mod - 1) / (mid << 1));
    for (int j = 0; j <= lim - 1; j += (mid << 1)) {
      long long w = 1;
      for (int k = 0; k <= mid - 1; ++k, w = (w * Wn) % mod) {
        int x = A[j + k];
        int y = w * A[j + mid + k] % mod;
        A[j + k] = (x + y) % mod;
        A[j + mid + k] = (x - y + mod) % mod;
      }
    }
  }
  if (type == -1) {
    long long tmp = getinv(lim);
    for (int i = 0; i <= lim - 1; ++i) {
      A[i] = A[i] * tmp % mod;
    }
  }
}
vector<long long> operator*(vector<long long> A, vector<long long> B) {
  int len = A.size() + B.size() - 1;
  lim = 1;
  while (lim <= len) lim <<= 1;
  for (int i = 0; i <= lim - 1; ++i) {
    r[i] = (r[i >> 1] >> 1) | ((i & 1) * (lim >> 1));
  }
  A.resize(lim);
  B.resize(lim);
  ntt(A, 1);
  ntt(B, 1);
  for (int i = 0; i <= lim - 1; ++i) {
    A[i] = A[i] * B[i] % mod;
  }
  ntt(A, -1);
  A.resize(len);
  return A;
}
vector<long long> solve(int l, int r) {
  if (l == r) {
    vector<long long> tmp({1, (int)e[l].size() - (l != 1)});
    return tmp;
  }
  int mid = (l + r) / 2;
  return solve(l, mid) * solve(mid + 1, r);
}
void main0() {
  init();
  cin >> n;
  for (int i = 1; i <= n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  vector<long long> v = solve(1, n);
  long long ans = 0;
  for (int i = 0; i <= n - 1; ++i) {
    ans += (i & 1 ? -1 : 1) * v[i] * fac[n - i] % mod;
    ans %= mod;
  }
  ans += mod;
  ans %= mod;
  cout << ans << endl;
}

```