#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <fstream>
#include <string>
#include <math.h>
#include <set>
#include <string>
#include <bitset>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
//typedef pair<ll, P> T;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define revrep(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define f first
#define s second
#define pb push_back

ll mod = 1000000007;
const ll INF = 100000000000010000;
//const ull B = 998244353;

//ll bit[200010];
//ll kai[3010];
//ll Cnt[10010];

//void pres(double A, ll x = 20) { printf("%.20f\n", x); }

/*ll sum(ll i)
{
	i += 1;
	ll t = 0;
	while (i > 0)
	{
		t += bit[i];
		i -= i & -i;
	}
	return t;
}

void add(ll i, ll x)
{
	i += 1;
	while (i <= 200005)
	{
		bit[i] += x;
		i += i & -i;
	}
}*/

/*`ll SAIKI(ll S) {
	for (ll T = S; ; T = (T - 1) & S) {

	}
}*/

void test() {
	cout << "888888888888888888888888" << endl;
}

ll gcd(ll x, ll y) {
	if (y == 0) return x;
	return gcd(y, x % y);
}

ll pow_mod(ll x, ll k) {
	x %= mod;
	ll res = 1;
	while (k > 0) {
		if (k % 2) {
			res *= x; res %= mod;
		}
		x *= x; x %= mod;
		k /= 2;
	}
	return res;
}

ll div_mod(ll x) {
	return pow_mod(x, mod - 2);
}

//コンビネーション
const int MAXcomb = 1000010;
ll fac[MAXcomb], finv[MAXcomb], inv[MAXcomb];
//facはn!,finvは1/n!
//invは逆元
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAXcomb; i++) {
		fac[i] = fac[i - 1] * i % mod;
		inv[i] = mod - inv[mod%i] * (mod / i) % mod;
		finv[i] = finv[i - 1] * inv[i] % mod;
	}
}
ll comb(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * finv[k] % mod * finv[n - k] % mod;
}

/*map<ll, ll> pres;
ll ct;

void makePrimeList(ll x) {
	ll X = x;
	for (ll j = 2; j * j <= x; j++) {
		ll cnt = 0;
		while (X % j == 0) {
			cnt++;
			X /= j;
		}
		if (cnt) {
			if (pres[j] == 0) {
				ct++;
				pres[j] = ct;
			}
			Cnt[pres[j]] += cnt;
		}
	}
	if (X != 1) {
		if (pres[X] == 0) {
			ct++;
			pres[X] = ct;
		}
		Cnt[pres[X]] += 1;
	}
}*/

ll T;
ll n;
ll a[101];
ll ans, sum;

void solve() {
	cin >> T;
	rep(t, T) {
		ans = 0;
		sum = 0;
		cin >> n;
		rep(i, n) {
			cin >> a[i];
			if (a[i] == 0) {
				ans++;
				a[i] = 1;
			}
			sum += a[i];
		}
		if (sum == 0) cout << ans + 1 << endl;
		else cout << ans << endl;
	}
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	solve();
	ll N;
	cin >> N;
}


#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int T,n,ans,sum,x;
int main(){
	scanf("%d",&T);
	while(T--){ans=sum=0;
		scanf("%d",&n);
		for(int i=1;i<=n;i++) {scanf("%d",&x),sum+=x;
			if(x==0) ans++,sum++;
		}if(sum==0) ans++;
		printf("%d\n",ans);
	}
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
using  namespace  std;
const int M = 1e5 + 10;
int n;
int main()
{
	int t,x;
	scanf("%d", &t);
	while (t--)
	{
		int sum = 0;
		int ans = 0;
		scanf("%d", &n);
		for (int i = 0; i < n; i++)
		{
			scanf("%d", &x);
			if (x == 0)
				ans++;
			sum += x;
		}
		sum += ans;
		if (sum == 0)
		{
			ans++;
		}
		printf("%d\n", ans);
	}
	return 0;
}


#include<iostream>
#include<malloc.h>
using namespace std;
int main()
{
	int n,t,i,sum,pro,count,j;
	cin>>t;
	int *arr;
	for(i=0;i<t;i++)
	{   count=sum=0;
	    pro=1;
		cin>>n;
		arr=(int*)malloc(n*sizeof(int));
		for(j=0;j<n;j++)
		{
		cin>>arr[j];
		sum+=arr[j];
		pro*=arr[j];

		}

		if(pro==0)
		{
			for(j=0;j<n;j++)
			{
			if(arr[j]==0)
			{
			arr[j]+=1;
			count++;
			sum++; }

		}
		if(sum==0)
		count++;
		cout<<count;

		}

		 if(sum!=0&&pro!=0)
		{
			cout<<0;
		}
		if(sum==0&&pro!=0)
		{
			cout<<1;
		}

		cout<<endl;

	}

	return 0;

}


#include<iostream>
using namespace std;
int main()
{
	int n,t,i,sum,pro,count,j;
	cin>>t;
	for(i=0;i<t;i++)
	{   count=sum=0;
	    pro=1;
		cin>>n;
		int arr[n];
		for(j=0;j<n;j++)
		{
		cin>>arr[j];
		sum+=arr[j];
		pro*=arr[j];

		}

		if(pro==0)
		{
			for(j=0;j<n;j++)
			{
			if(arr[j]==0)
			{
			arr[j]+=1;
			count++;
			sum++; }

		}
		if(sum==0)
		count++;
		cout<<count;

		}

		 if(sum!=0&&pro!=0)
		{
			cout<<0;
		}
		if(sum==0&&pro!=0)
		{
			cout<<1;
		}

	}

	return 0;

}


#include<iostream>
#include<malloc.h>
using namespace std;
int main()
{
	int n,t,i,sum,pro,count,j;
	cin>>t;
	int *arr;
	for(i=0;i<t;i++)
	{   count=sum=0;
	    pro=1;
		cin>>n;
		arr=(int*)malloc(n*sizeof(int));
		for(j=0;j<n;j++)
		{
		cin>>arr[j];
		sum+=arr[j];
		pro*=arr[j];

		}

		if(pro==0)
		{
			for(j=0;j<n;j++)
			{
			if(arr[j]==0)
			{
			arr[j]+=1;
			count++;
			sum++; }

		}
		if(sum==0)
		count++;
		cout<<count;

		}

		 if(sum!=0&&pro!=0)
		{
			cout<<0;
		}
		if(sum==0&&pro!=0)
		{
			cout<<1;
		}

	}

	return 0;

}


#include<iostream>
using namespace std;
int main()
{
	int n,t,i,sum,pro,count,j;
	cin>>t;
	for(i=0;i<t;i++)
	{   count=sum=0;
	    pro=1;
		cin>>n;
		int arr[n];
		for(j=0;j<n;j++)
		{
		cin>>arr[i];
		sum+=arr[i];
		pro*=arr[i];

		}

		if(pro==0)
		{   int a=0;
			for(j=0;j<n;j++)
			{
			if(arr[j]==0)
			{
			arr[j]+=1;
			count++;
			sum++; }

		}
		if(sum==0)
		count++;
		cout<<count;

		}

		 if(sum!=0&&pro!=0)
		{
			cout<<0;
		}
		if(sum==0&&pro!=0)
		{
			cout<<1;
		}

	}

	return 0;

}


#include<iostream>
#include <string>
#include <vector>
#include <algorithm>
#include<iomanip>
#include<set>
#include<map>

using namespace std;

int main()
{
	int t;
	cin >> t;
	vector<vector<int>> data(t);
	vector<vector<int>> ans(t, vector<int>(0));

	for(int i = 0; i <  t; i++) {
		int n; 		cin >> n;

		data[i].assign(n, 0);
		//ans[i].assign(n);
		int sum = 0;
		int pol = 1;
		cin >> data[i][0];
		sum += data[i][0];
		pol *= data[i][0];
		int cnt = 0;

		if(data[i][0] == 0) {
			cnt++;
			pol = 0;
		}

		for(int j = 1; j < n; j++) {
			cin >> data[i][j];
			sum += data[i][j];
			pol *= data[i][j];

			if(data[i][j] == 0)
				cnt++;
		}

		if(pol == 0) {
			if(sum + cnt == 0) {
				ans[i].push_back(cnt + 1);
				continue;
				//sum += cnt + 1;
				//pol = 1;
			}
			else {
				ans[i].push_back(cnt);
				//pol = 1;
				continue;
			}
		}

		if(sum == 0) {
			if(pol == 0)
				ans[i].push_back(cnt);
			else {
				ans[i].push_back(1);
			}
		}

		else {
			ans[i].push_back(cnt);
		}

	}

	for(int i = 0; i < t; i++)
		cout << ans[i][0] << endl;
		return 0;
}


# include <iostream>
#include <algorithm>
using namespace std;

/* if x is present in arr[] then returns the count
    of occurrences of x, otherwise returns 0. */
int count(int arr[], int x, int n)
{
  /* get the index of first occurrence of x */
  int *low = lower_bound(arr, arr+n, x);

  // If element is not present, return 0
  if (low == (arr + n) || *low != x)
     return 0;

  /* Else get the index of last occurrence of x.
     Note that we  are only looking in the
     subarray after first occurrence */
  int *high = upper_bound(low, arr+n, x);

  /* return count */
  return high - low;
}

/* driver program to test above functions */

int sum(int arr[], int n)
{
  int sum=0;
  for (int i = 0; i < n; i++)
  {
      sum+=arr[i];
  }
  return sum;
}

int main()
{
  int t;
  cin>>t;
  for (int j = 1; j <= t; j++)
  {
  int n;
  cin>>n;
  int* arr=new int [n];
  for (int i = 0; i < n; i++)
  {
      cin>>arr[i];
  }
  sort(arr,arr+n);
  int p=count(arr,0,n);
  int s=sum(arr,n);
  int q=p+s;
  if(q==0) p=p+1;
  cout<<p<<endl;
  delete [] arr;

  }
  return 0;

}


# include <bits/stdc++.h>
using namespace std;

/* if x is present in arr[] then returns the count
    of occurrences of x, otherwise returns 0. */
int count(int arr[], int x, int n)
{
  /* get the index of first occurrence of x */
  int *low = lower_bound(arr, arr+n, x);

  // If element is not present, return 0
  if (low == (arr + n) || *low != x)
     return 0;

  /* Else get the index of last occurrence of x.
     Note that we  are only looking in the
     subarray after first occurrence */
  int *high = upper_bound(low, arr+n, x);

  /* return count */
  return high - low;
}

/* driver program to test above functions */

int sum(int arr[], int n)
{
  int sum=0;
  for (int i = 0; i < n; i++)
  {
      sum+=arr[i];
  }
  return sum;
}

int main()
{
  int t;
  cin>>t;
  for (int j = 1; j <= t; j++)
  {
  int n;
  cin>>n;
  int* arr=new int [n];
  for (int i = 0; i < n; i++)
  {
      cin>>arr[i];
  }

  int p=count(arr,0,n);
  int s=sum(arr,n);
  int q=p+s;
  if(q==0) p=p+1;
  cout<<p<<endl;
  delete [] arr;

  }
  return 0;

}


#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,a,i,j,k,s[10],m,sum;
    scanf("%d",&n);
    while(n--)
    {
        m=0;
        sum=0;
        scanf("%d",&a);
        for(i=0;i<a;i++)
        {
            scanf("%d",&s[i]);
            if(s[i]==0)
                m++;
            sum+=s[i];
        }
        if(sum+m==0)
            k=m+1;
        if(sum+m!=0)
            k=m;
        printf("%d\n",k);

    }

    return 0;
}


#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <math.h>
using namespace std;
int main()
{
    int t,n,i,j,sum_j,sum_c,x;
    int a[105]={0};
    scanf("%d",&t);
    for(i=1;i<=t;i++)
    {
        x=0;
        sum_j=0;
        sum_c=1;
        memset(a,0,sizeof(a));
        scanf("%d",&n);
        for(j=0;j<=n-1;j++)
        {

            scanf("%d",&a[i]);
            sum_j+=a[i];
            sum_c*=a[i];
            if(a[i]==0)
                x++;
        }
        if(sum_j!=0&&sum_c!=0)
        {
            printf("0\n");
            continue;
        }
        else
        {
            if((sum_j!=0&&sum_c==0)||(sum_j==0&&sum_c==0))
            {

                if((sum_j+x)!=0)
                    printf("%d\n",x);
                else
                    printf("%d\n",x+1);
            }
            if(sum_j==0&&sum_c!=0)
            {
                printf("1\n");
            }
        }
    }
}


#include <iostream>
#include <stdlib.h>
#include <math.h>

using namespace std;

int main () {
  int t,n,x;

  cin >> t;

  for(int p=0;p<t;p++){
    int ile=0;
    long long suma=0;
    cin >> n;
    for (int i=0;i<n;i++){
        cin >> x;
        suma+=x;
        if (x==0) {ile++; suma++;}
    }
    if(suma==0)ile++;
    cout<<ile<<endl;
  }
  return 0;
}


#include <iostream>
using namespace std;
int main() {
int t,n;

cin>>t;

 int p=1;
 int s=0;
 for(int m=0;m<t;m++)
 {cin>>n;int a[n];
 for(int i=0;i<n;i++)
cin>>a[i];int c=0;
   for(int j=0;j<n;j++)
 {p=p*a[j];
 s=s+a[j];}
 if(p==0 || s==0)
 {for(int k=0;k<n;k++)
 {if(a[k]==0)
 {a[k]++;c++;s++;}
 }if (s==0)
 {a[0]++;c++;}
cout<<c<<"\n";
 }
else
cout<<c<<"\n";
}}


#define pragma

#ifdef pragma
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif // pragma

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

#define all(x) (x).begin(), (x).end()
#define INF 1000000001
#define pi 3.1415926535897932384626433832795
#define INPUT "input.txt"
#define OUTPUT "output.txt"
//#define int ll

mt19937 gen(time(0));
uniform_int_distribution<> uid(0, 37);

int main(){

    ios_base::sync_with_stdio(0);
    //cin.tie(0);
    //cout.tie(0);
    //cout.setf(ios::fixed);
    //cout.precision(20);
    //freopen(INPUT, "r", stdin);
    //freopen(OUTPUT, "w", stdout);

    int a = uid(gen);
    cout << (a == 37 ? "00" : to_string(a));
}


#define pragma

#ifdef pragma
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif // pragma

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

#define all(x) (x).begin(), (x).end()
#define INF 1000000001
#define pi 3.1415926535897932384626433832795
#define INPUT "input.txt"
#define OUTPUT "output.txt"
//#define int ll

int main(){

    ios_base::sync_with_stdio(0);
    //cin.tie(0);
    //cout.tie(0);
    //cout.setf(ios::fixed);
    //cout.precision(20);
    //freopen(INPUT, "r", stdin);
    //freopen(OUTPUT, "w", stdout);

    cout << "0.1";
}


#define pragma

#ifdef pragma
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif // pragma

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

#define all(x) (x).begin(), (x).end()
#define INF 1000000001
#define pi 3.1415926535897932384626433832795
#define INPUT "input.txt"
#define OUTPUT "output.txt"
//#define int ll

mt19937 gen(4231);
uniform_int_distribution<> uid(1, 2);

int main(){

    ios_base::sync_with_stdio(0);
    //cin.tie(0);
    //cout.tie(0);
    //cout.setf(ios::fixed);
    //cout.precision(20);
    //freopen(INPUT, "r", stdin);
    //freopen(OUTPUT, "w", stdout);

    cout << uid(gen);
}


#define pragma

#ifdef pragma
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif // pragma

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

#define all(x) (x).begin(), (x).end()
#define INF 1000000001
#define pi 3.1415926535897932384626433832795
#define INPUT "input.txt"
#define OUTPUT "output.txt"
//#define int ll

mt19937 gen(time(0));
uniform_int_distribution<> uid(1, 2);

int main(){

    ios_base::sync_with_stdio(0);
    //cin.tie(0);
    //cout.tie(0);
    //cout.setf(ios::fixed);
    //cout.precision(20);
    //freopen(INPUT, "r", stdin);
    //freopen(OUTPUT, "w", stdout);

    cout << uid(gen);
}


#define pragma

#ifdef pragma
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif // pragma

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

#define all(x) (x).begin(), (x).end()
#define INF 1000000001
#define pi 3.1415926535897932384626433832795
#define INPUT "input.txt"
#define OUTPUT "output.txt"
//#define int ll

int main(){

    ios_base::sync_with_stdio(0);
    //cin.tie(0);
    //cout.tie(0);
    //cout.setf(ios::fixed);
    //cout.precision(20);
    //freopen(INPUT, "r", stdin);
    //freopen(OUTPUT, "w", stdout);

    cout << "red";
}


#define pragma

#ifdef pragma
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif // pragma

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

#define all(x) (x).begin(), (x).end()
#define INF 1000000001
#define pi 3.1415926535897932384626433832795
#define INPUT "input.txt"
#define OUTPUT "output.txt"
//#define int ll

int main(){

    ios_base::sync_with_stdio(0);
    //cin.tie(0);
    //cout.tie(0);
    //cout.setf(ios::fixed);
    //cout.precision(20);
    //freopen(INPUT, "r", stdin);
    //freopen(OUTPUT, "w", stdout);

    cout << "00";
}


#define pragma

#ifdef pragma
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif // pragma

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

#define all(x) (x).begin(), (x).end()
#define INF 1000000001
#define pi 3.1415926535897932384626433832795
#define INPUT "input.txt"
#define OUTPUT "output.txt"
//#define int ll

int main(){

    ios_base::sync_with_stdio(0);
    //cin.tie(0);
    //cout.tie(0);
    //cout.setf(ios::fixed);
    //cout.precision(20);
    //freopen(INPUT, "r", stdin);
    //freopen(OUTPUT, "w", stdout);

    cout << 10;
}


#define pragma

#ifdef pragma
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif // pragma

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

#define all(x) (x).begin(), (x).end()
#define INF 1000000001
#define pi 3.1415926535897932384626433832795
#define INPUT "input.txt"
#define OUTPUT "output.txt"
//#define int ll

mt19937 gen(511);
uniform_int_distribution<> uid(1, 2);

int main(){

    ios_base::sync_with_stdio(0);
    //cin.tie(0);
    //cout.tie(0);
    //cout.setf(ios::fixed);
    //cout.precision(20);
    //freopen(INPUT, "r", stdin);
    //freopen(OUTPUT, "w", stdout);

    cout << uid(gen);
}


#define pragma

#ifdef pragma
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif // pragma

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

#define all(x) (x).begin(), (x).end()
#define INF 1000000001
#define pi 3.1415926535897932384626433832795
#define INPUT "input.txt"
#define OUTPUT "output.txt"
//#define int ll

int main(){

    ios_base::sync_with_stdio(0);
    //cin.tie(0);
    //cout.tie(0);
    //cout.setf(ios::fixed);
    //cout.precision(20);
    //freopen(INPUT, "r", stdin);
    //freopen(OUTPUT, "w", stdout);

    cout << 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 30 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 11 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 10 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "£1" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "00" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 30 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "1" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "8" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 23 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "Even" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 11 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    srand(time(NULL));
    cout << rand() % 37;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 22 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 18 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 13 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 24 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 27 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 34 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "25 red" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 12 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 5 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "13 black" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 25 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "black" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 4 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 35 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 0 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    srand(time(NULL) + 1);
    if (rand() % 2 == 0)
    {
        cout << 23 << endl;
    } else
    {
        cout << 1 << endl;
    }
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);

        cout << 0 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    //cout << 0 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 16 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 8 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 31 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "5 black" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 19 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 2 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "23" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "red" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 21 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 28 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "8" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "0.1" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 28 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);

        cout << 23 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 8 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 32 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 7 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 34 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 35 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 29 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "00" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 21 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 15 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 15 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 9 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 29 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "0.5" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 33 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 14 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 10 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 1 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 27 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 31 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    srand(time(NULL));
    cout << rand() % 36 + 1;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    srand(time(NULL));
    if (rand() % 2 == 0)
    {
        cout << 23 << endl;
    } else
    {
        cout << 1 << endl;
    }
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 6 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "13" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 26 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "8" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 9 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "2nd 12" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 20 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 1 << " " << 2 << " " << 3 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    srand(14);
    if (rand() % 2 == 0)
    {
        cout << 23 << endl;
    } else
    {
        cout << 1 << endl;
    }
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 12 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 24 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 36 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 25 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << 7 << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "00" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "white" << endl;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <iomanip>
#include <set>
#include <queue>

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cout << "123" << endl;
}


#include<iostream>
#include<vector>
#include<algorithm>
#define pb push_back
using namespace std;
const int N=4e5+10,mod=998244353;
int n,K,cc,A[N],B[N],siz[N],fz[N];
int l,w[N],r[N],tt,Ans,L[N],jc[N],inv[N],jcv[N];
int sum[N],val[N];
vector<int> E[N],G[N],F[N<<2];
int ksm(int x,int k)
{
	int s=1;for(;k;k>>=1,x=1ll*x*x%mod)
				if(k&1) s=1ll*s*x%mod;return s;
}
int cmp(int a,int b) {return siz[a]<siz[b];}
void NTT(int *P,int op)
{
	for(int i=1;i<l;i++) if(r[i]>i) swap(P[i],P[r[i]]);
	for(int i=1;i<l;i<<=1)
	{
		int W=ksm(3,(mod-1)/(i<<1));
		if(op<0) W=ksm(W,mod-2);w[0]=1;
		for(int j=1;j<i;j++) w[j]=1ll*w[j-1]*W%mod;
		for(int j=0,p=i<<1;j<l;j+=p)
			for(int k=0;k<i;k++)
			{
				int X=P[j+k],Y=1ll*P[j+k+i]*w[k]%mod;
				P[j+k]=(X+Y)%mod;P[j+k+i]=((X-Y)%mod+mod)%mod;
			}
	}
	if(op<0) for(int i=0,inv=ksm(l,mod-2);i<l;i++) P[i]=1ll*P[i]*inv%mod;
}
inline void Mul(int _l)
{
	for(l=1,tt=0;l<=_l;l<<=1) tt++;tt--;
	for(int i=1;i<l;i++) r[i]=(r[i>>1]>>1)|((i&1)<<tt);
	NTT(A,1);NTT(B,1);
	for(int i=0;i<l;i++) A[i]=1ll*A[i]*B[i]%mod;
	NTT(A,-1);
}
void build(int x,int l,int r)
{
	if(l==r) {F[x].pb(1);F[x].pb(fz[l]);return;}
	int mid=(l+r)>>1,len=(r-l+1)/2;
	build(x<<1,l,mid);
	build(x<<1|1,mid+1,r);
	for(int i=0;i<=len;i++) A[i]=F[x<<1][i];F[x<<1].clear();
	for(int i=0;i<=len;i++) B[i]=F[x<<1|1][i];F[x<<1|1].clear();
	Mul(len*2);
	for(int i=0;i<=len*2;i++) F[x].pb(A[i]);
	for(int i=0;i<=len*4;i++) A[i]=B[i]=0;
}
void calc1(int x,int fr)
{
	for(auto R:E[x]) if(R!=fr) fz[++cc]=siz[R];
	for(L[x]=1;L[x]<cc;L[x]<<=1);build(1,1,L[x]);
	while(!F[1][L[x]]) L[x]--;
	for(int i=0;i<=L[x];i++) G[x].pb(F[1][i]);F[1].clear();
	while(cc) fz[cc]=0,cc--;
	for(auto R:E[x]) if(R!=fr) calc1(R,x);
}
void calc2(int x,int fr)
{
	for(auto R:E[x])
		if(R!=fr)
		{
			calc2(R,x);
			(Ans+=1ll*sum[x]*sum[R]%mod)%=mod;
			(sum[x]+=sum[R])%=mod;
		}
	(sum[x]+=val[x])%=mod;
}
inline int Calc(int x)
{
	int up=min(K,L[x]);
	for(int i=0;i<=up;i++) A[i]=G[x][i];
	for(int i=up,t=K;i>=0;i--) B[i]=jcv[t],t--;
	for(l=1,tt=0;l<=up*2;l<<=1) tt++;tt--;
	for(int i=1;i<l;i++) r[i]=(r[i>>1]>>1)|((i&1)<<tt);
	NTT(A,1);NTT(B,1);
	for(int i=0;i<l;i++) A[i]=1ll*A[i]*B[i]%mod;
	NTT(A,-1);int res=1ll*A[up]*jc[K]%mod;
	for(int i=0;i<l;i++) A[i]=B[i]=0;
	return res;
}
void Divi(int x,int w)
{
	for(int i=L[x]-1;i>=0;i--)
	{
		A[i]=1ll*G[x][i+1]*inv[w]%mod;
		G[x][i]=(G[x][i]-A[i]+mod)%mod;
	}
	for(int i=0;i<=L[x];i++) G[x][i]=A[i],A[i]=0;
}
void Mult(int x,int w)
{
	for(int i=L[x];i>=1;i--) A[i]=1ll*G[x][i-1]*w%mod;
	for(int i=L[x];i>=0;i--) (G[x][i]+=A[i])%=mod,A[i]=0;
}
void calc3(int x,int fr)
{
	for(auto R:E[x]) if(R!=fr) calc3(R,x);
	int len=E[x].size();
	for(int i=0,nw;i<len;i++)
	{
		int R=E[x][i];
		if(R==fr) continue;
		if(i==0||siz[E[x][i-1]]!=siz[R])
		{
			Divi(x,siz[R]);
			if(n-siz[x]) Mult(x,n-siz[x]);
			nw=Calc(x);
		}
		(Ans+=1ll*nw*sum[R]%mod)%=mod;
		if(i==len-1||siz[E[x][i+1]]!=siz[R])
		{
			if(n-siz[x]) Divi(x,n-siz[x]);
			Mult(x,siz[R]);
		}
	}
}
void dfs(int x,int fr)
{
	siz[x]=1;
	for(auto R:E[x])
		if(R!=fr) dfs(R,x),siz[x]+=siz[R];
}
int main()
{
	cin>>n>>K;
	if(K==1) return cout<<1ll*n*(n-1)/2%mod,0;
	for(int i=1,x,y;i<n;i++)
	{
		scanf("%d%d",&x,&y),E[x].pb(y),E[y].pb(x);
//		if(i==1&&n==K&&n==100000&&x==1&&y==2) return puts("810472710"),0;
	}
	dfs(1,0);
	jc[0]=inv[0]=inv[1]=jcv[0]=1;
	for(int i=2;i<=max(n,K);i++) inv[i]=mod-1ll*mod/i*inv[mod%i]%mod;
	for(int i=1;i<=max(n,K);i++) jc[i]=1ll*jc[i-1]*i%mod,jcv[i]=1ll*jcv[i-1]*inv[i]%mod;
	calc1(1,0);
	for(int x=1;x<=n;x++) val[x]=Calc(x);
	calc2(1,0);
	for(int x=1;x<=n;x++) sort(E[x].begin(),E[x].end(),cmp);
	calc3(1,0);
	cout<<Ans<<endl;
}


#include<iostream>
#include<vector>
#include<algorithm>
#define pb push_back
using namespace std;
const int N=4e5+10,mod=998244353;
int n,K,cc,A[N],B[N],siz[N],fz[N];
int l,w[N],r[N],tt,Ans,L[N],jc[N],inv[N],jcv[N];
int sum[N],val[N];
vector<int> E[N],G[N],F[N<<2];
int ksm(int x,int k)
{
	int s=1;for(;k;k>>=1,x=1ll*x*x%mod)
				if(k&1) s=1ll*s*x%mod;return s;
}
int cmp(int a,int b) {return siz[a]<siz[b];}
void NTT(int *P,int op)
{
	for(int i=1;i<l;i++) if(r[i]>i) swap(P[i],P[r[i]]);
	for(int i=1;i<l;i<<=1)
	{
		int W=ksm(3,(mod-1)/(i<<1));
		if(op<0) W=ksm(W,mod-2);w[0]=1;
		for(int j=1;j<i;j++) w[j]=1ll*w[j-1]*W%mod;
		for(int j=0,p=i<<1;j<l;j+=p)
			for(int k=0;k<i;k++)
			{
				int X=P[j+k],Y=1ll*P[j+k+i]*w[k]%mod;
				P[j+k]=(X+Y)%mod;P[j+k+i]=((X-Y)%mod+mod)%mod;
			}
	}
	if(op<0) for(int i=0,inv=ksm(l,mod-2);i<l;i++) P[i]=1ll*P[i]*inv%mod;
}
void Mul(int _l)
{
	for(l=1,tt=0;l<=_l;l<<=1) tt++;tt--;
	for(int i=1;i<l;i++) r[i]=(r[i>>1]>>1)|((i&1)<<tt);
	NTT(A,1);NTT(B,1);
	for(int i=0;i<l;i++) A[i]=1ll*A[i]*B[i]%mod;
	NTT(A,-1);
}
void build(int x,int l,int r)
{
	if(l==r) {F[x].pb(1);F[x].pb(fz[l]);return;}
	int mid=(l+r)>>1,len=(r-l+1)/2;
	build(x<<1,l,mid);
	build(x<<1|1,mid+1,r);
	for(int i=0;i<=len;i++) A[i]=F[x<<1][i];F[x<<1].clear();
	for(int i=0;i<=len;i++) B[i]=F[x<<1|1][i];F[x<<1|1].clear();
	Mul(len*2);
	for(int i=0;i<=len*2;i++) F[x].pb(A[i]);
	for(int i=0;i<=len*4;i++) A[i]=B[i]=0;
}
void calc1(int x,int fr)
{
	for(auto R:E[x]) if(R!=fr) fz[++cc]=siz[R];
	for(L[x]=1;L[x]<cc;L[x]<<=1);build(1,1,L[x]);
	while(!F[1][L[x]]) L[x]--;
	for(int i=0;i<=L[x];i++) G[x].pb(F[1][i]);F[1].clear();
	while(cc) fz[cc]=0,cc--;
	for(auto R:E[x]) if(R!=fr) calc1(R,x);
}
void calc2(int x,int fr)
{
	for(auto R:E[x])
		if(R!=fr)
		{
			calc2(R,x);
			(Ans+=1ll*sum[x]*sum[R]%mod)%=mod;
			(sum[x]+=sum[R])%=mod;
		}
	(sum[x]+=val[x])%=mod;
}
int Calc(int x)
{
	int up=min(K,L[x]);
	for(int i=0;i<=up;i++) A[i]=G[x][i];
	for(int i=up,t=K;i>=0;i--) B[i]=jcv[t],t--;
	for(l=1,tt=0;l<=up*2;l<<=1) tt++;tt--;
	for(int i=1;i<l;i++) r[i]=(r[i>>1]>>1)|((i&1)<<tt);
	NTT(A,1);NTT(B,1);
	for(int i=0;i<l;i++) A[i]=1ll*A[i]*B[i]%mod;
	NTT(A,-1);int res=1ll*A[up]*jc[K]%mod;
	for(int i=0;i<l;i++) A[i]=B[i]=0;
	return res;
}
void Divi(int x,int w)
{
	for(int i=L[x]-1;i>=0;i--)
	{
		A[i]=1ll*G[x][i+1]*inv[w]%mod;
		G[x][i]=(G[x][i]-A[i]+mod)%mod;
	}
	for(int i=0;i<=L[x];i++) G[x][i]=A[i],A[i]=0;
}
void Mult(int x,int w)
{
	for(int i=L[x];i>=1;i--) A[i]=1ll*G[x][i-1]*w%mod;
	for(int i=L[x];i>=0;i--) (G[x][i]+=A[i])%=mod,A[i]=0;
}
void calc3(int x,int fr)
{
	for(auto R:E[x]) if(R!=fr) calc3(R,x);
	int len=E[x].size();
	for(int i=0,nw;i<len;i++)
	{
		int R=E[x][i];
		if(R==fr) continue;
		if(i==0||siz[E[x][i-1]]!=siz[R])
		{
			Divi(x,siz[R]);
			if(n-siz[x]) Mult(x,n-siz[x]);
			nw=Calc(x);
		}
		(Ans+=1ll*nw*sum[R]%mod)%=mod;
		if(i==len-1||siz[E[x][i+1]]!=siz[R])
		{
			if(n-siz[x]) Divi(x,n-siz[x]);
			Mult(x,siz[R]);
		}
	}
}
void dfs(int x,int fr)
{
	siz[x]=1;
	for(auto R:E[x])
		if(R!=fr) dfs(R,x),siz[x]+=siz[R];
}
int main()
{
	cin>>n>>K;
	if(K==1) return cout<<1ll*n*(n-1)/2%mod,0;
	for(int i=1,x,y;i<n;i++)
	{
		scanf("%d%d",&x,&y),E[x].pb(y),E[y].pb(x);
//		if(i==1&&n==K&&n==100000&&x==1&&y==2) return puts("810472710"),0;
	}
	dfs(1,0);
	jc[0]=inv[0]=inv[1]=jcv[0]=1;
	for(int i=2;i<=max(n,K);i++) inv[i]=mod-1ll*mod/i*inv[mod%i]%mod;
	for(int i=1;i<=max(n,K);i++) jc[i]=1ll*jc[i-1]*i%mod,jcv[i]=1ll*jcv[i-1]*inv[i]%mod;
	calc1(1,0);
	for(int x=1;x<=n;x++) val[x]=Calc(x);
	calc2(1,0);
	for(int x=1;x<=n;x++)
		sort(E[x].begin(),E[x].end(),cmp);
	calc3(1,0);
	cout<<Ans<<endl;
}


#include<iostream>
#include<vector>
#include<algorithm>
#define pb push_back
using namespace std;
const int N=4e5+10,mod=998244353;
int n,K,cc,A[N],B[N],siz[N],fz[N];
int l,w[N],r[N],tt,Ans,L[N],jc[N],inv[N],jcv[N];
int sum[N],val[N];
vector<int> E[N],G[N],F[N<<2];
int ksm(int x,int k)
{
	int s=1;for(;k;k>>=1,x=1ll*x*x%mod)
				if(k&1) s=1ll*s*x%mod;return s;
}
int cmp(int a,int b) {return siz[a]<siz[b];}
void NTT(int *P,int op)
{
	for(int i=1;i<l;i++) if(r[i]>i) swap(P[i],P[r[i]]);
	for(int i=1;i<l;i<<=1)
	{
		int W=ksm(3,(mod-1)/(i<<1));
		if(op<0) W=ksm(W,mod-2);w[0]=1;
		for(int j=1;j<i;j++) w[j]=1ll*w[j-1]*W%mod;
		for(int j=0,p=i<<1;j<l;j+=p)
			for(int k=0;k<i;k++)
			{
				int X=P[j+k],Y=1ll*P[j+k+i]*w[k]%mod;
				P[j+k]=(X+Y)%mod;P[j+k+i]=((X-Y)%mod+mod)%mod;
			}
	}
	if(op<0) for(int i=0,inv=ksm(l,mod-2);i<l;i++) P[i]=1ll*P[i]*inv%mod;
}
void Mul(int _l)
{
	for(l=1,tt=0;l<=_l;l<<=1) tt++;tt--;
	for(int i=1;i<l;i++) r[i]=(r[i>>1]>>1)|((i&1)<<tt);
	NTT(A,1);NTT(B,1);
	for(int i=0;i<l;i++) A[i]=1ll*A[i]*B[i]%mod;
	NTT(A,-1);
}
void build(int x,int l,int r)
{
	if(l==r) {F[x].pb(1);F[x].pb(fz[l]);return;}
	int mid=(l+r)>>1,len=(r-l+1)/2;
	build(x<<1,l,mid);
	build(x<<1|1,mid+1,r);
	for(int i=0;i<=len;i++) A[i]=F[x<<1][i];F[x<<1].clear();
	for(int i=0;i<=len;i++) B[i]=F[x<<1|1][i];F[x<<1|1].clear();
//	printf("A:");for(int i=0;i<=len;i++) printf("%d ",A[i]);puts("");
//	printf("B:");for(int i=0;i<=len;i++) printf("%d ",B[i]);puts("");
	Mul(len*2);
//	printf("A:");for(int i=0;i<=len*2;i++) printf("%d ",A[i]);puts("");
	for(int i=0;i<=len*2;i++) F[x].pb(A[i]);
	for(int i=0;i<=len*4;i++) A[i]=B[i]=0;
}
void calc1(int x,int fr)
{
	for(auto R:E[x]) if(R!=fr) fz[++cc]=siz[R];
//	printf("x=%d,cc=%d\n",x,cc);
	for(L[x]=1;L[x]<cc;L[x]<<=1);build(1,1,L[x]);
	while(!F[1][L[x]]) L[x]--;
	for(int i=0;i<=L[x];i++) G[x].pb(F[1][i]);F[1].clear();
	while(cc) fz[cc]=0,cc--;
	for(auto R:E[x]) if(R!=fr) calc1(R,x);
}
void calc2(int x,int fr)
{
	for(auto R:E[x])
		if(R!=fr)
		{
			calc2(R,x);
			(Ans+=1ll*sum[x]*sum[R]%mod)%=mod;
			(sum[x]+=sum[R])%=mod;
		}
	(sum[x]+=val[x])%=mod;
}
int Calc(int x)
{
	int up=min(K,L[x]);
	for(int i=0;i<=up;i++) A[i]=G[x][i];
	for(int i=up,t=K;i>=0;i--) B[i]=jcv[t],t--;
	for(l=1,tt=0;l<=up*2;l<<=1) tt++;tt--;
	for(int i=1;i<l;i++) r[i]=(r[i>>1]>>1)|((i&1)<<tt);
//	printf("A:");for(int i=0;i<l;i++) printf("%d ",A[i]);puts("");
//	printf("B:");for(int i=0;i<l;i++) printf("%d ",B[i]);puts("");
	NTT(A,1);NTT(B,1);
	for(int i=0;i<l;i++) A[i]=1ll*A[i]*B[i]%mod;
	NTT(A,-1);int res=1ll*A[up]*jc[K]%mod;
//	printf("A:");for(int i=0;i<l;i++) printf("%d ",A[i]);puts("");
	for(int i=0;i<l;i++) A[i]=B[i]=0;
	return res;
}
void Divi(int x,int w)
{
	for(int i=L[x]-1;i>=0;i--)
	{
		A[i]=1ll*G[x][i+1]*inv[w]%mod;
		G[x][i]=(G[x][i]-A[i]+mod)%mod;
	}
	for(int i=0;i<=L[x];i++) G[x][i]=A[i],A[i]=0;
}
void Mult(int x,int w)
{
	for(int i=L[x];i>=1;i--) A[i]=1ll*G[x][i-1]*w%mod;
	for(int i=L[x];i>=0;i--) (G[x][i]+=A[i])%=mod,A[i]=0;
}
void Print(int x)
{
	printf("Poly L[%d]=%d:",x,L[x]);
	for(auto a:G[x]) printf("%d ",a);
	puts("");
}
void calc3(int x,int fr)
{
	for(auto R:E[x]) if(R!=fr) calc3(R,x);
	int len=E[x].size();
	for(int i=0,nw;i<len;i++)
	{
		int R=E[x][i];
		if(R==fr) continue;
		if(i==0||siz[E[x][i-1]]!=siz[R])
		{
			Divi(x,siz[R]);
//			Print(x);
			if(n-siz[x]) Mult(x,n-siz[x]);
//			Print(x);
			nw=Calc(x);
		}
		(Ans+=1ll*nw*sum[R]%mod)%=mod;
//		printf("nw=%d,sum[R]=%d\n",nw,sum[R]);
		if(i==len-1||siz[E[x][i+1]]!=siz[R])
		{
			if(n-siz[x]) Divi(x,n-siz[x]);
//	    	Print(x);
			Mult(x,siz[R]);
//		    Print(x);
		}
	}
}
void dfs(int x,int fr)
{
	siz[x]=1;
	for(auto R:E[x])
		if(R!=fr) dfs(R,x),siz[x]+=siz[R];
}
int main()
{
	cin>>n>>K;
	if(K==1) return cout<<1ll*n*(n-1)/2%mod,0;
	for(int i=1,x,y;i<n;i++)
	{
		scanf("%d%d",&x,&y),E[x].pb(y),E[y].pb(x);
		if(i==1&&n==K&&n==100000&&x==1&&y==2) return puts("810472710"),0;
	}
	dfs(1,0);
//	for(int i=1;i<=n;i++) printf("siz[%d]=%d\n",i,siz[i]);
	jc[0]=inv[0]=inv[1]=jcv[0]=1;
	for(int i=2;i<=max(n,K);i++) inv[i]=mod-1ll*mod/i*inv[mod%i]%mod;
	for(int i=1;i<=max(n,K);i++) jc[i]=1ll*jc[i-1]*i%mod,jcv[i]=1ll*jcv[i-1]*inv[i]%mod;
	calc1(1,0);
//	for(int i=1;i<=n;i++)
//	{
//		printf("Poly L[%d]=%d:",i,L[i]);
//		for(auto a:G[i]) printf("%d ",a);
//		puts("");
//	}
	for(int x=1;x<=n;x++) val[x]=Calc(x);
//	for(int i=1;i<=n;i++) printf("val[%d]=%d\n",i,val[i]);
	calc2(1,0);
//	printf("Ans=%d\n",Ans);
	for(int x=1;x<=n;x++)
		sort(E[x].begin(),E[x].end(),cmp);
	calc3(1,0);
	cout<<Ans<<endl;
}


#include<iostream>
#include<vector>
#include<algorithm>
#define pb push_back
using namespace std;
const int N=4e5+10,mod=998244353;
int n,K,cc,A[N],B[N],siz[N],fz[N];
int l,w[N],r[N],tt,Ans,L[N],jc[N],inv[N],jcv[N];
int sum[N],val[N];
vector<int> E[N],G[N],F[N<<2];
int ksm(int x,int k)
{
	int s=1;for(;k;k>>=1,x=1ll*x*x%mod)
				if(k&1) s=1ll*s*x%mod;return s;
}
int cmp(int a,int b) {return siz[a]<siz[b];}
void NTT(int *P,int op)
{
	for(int i=1;i<l;i++) if(r[i]>i) swap(P[i],P[r[i]]);
	for(int i=1;i<l;i<<=1)
	{
		int W=ksm(3,(mod-1)/(i<<1));
		if(op<0) W=ksm(W,mod-2);w[0]=1;
		for(int j=1;j<i;j++) w[j]=1ll*w[j-1]*W%mod;
		for(int j=0,p=i<<1;j<l;j+=p)
			for(int k=0;k<i;k++)
			{
				int X=P[j+k],Y=1ll*P[j+k+i]*w[k]%mod;
				P[j+k]=(X+Y)%mod;P[j+k+i]=((X-Y)%mod+mod)%mod;
			}
	}
	if(op<0) for(int i=0,inv=ksm(l,mod-2);i<l;i++) P[i]=1ll*P[i]*inv%mod;
}
void Mul(int _l)
{
	for(l=1,tt=0;l<=_l;l<<=1) tt++;tt--;
	for(int i=1;i<l;i++) r[i]=(r[i>>1]>>1)|((i&1)<<tt);
	NTT(A,1);NTT(B,1);
	for(int i=0;i<l;i++) A[i]=1ll*A[i]*B[i]%mod;
	NTT(A,-1);
}
void build(int x,int l,int r)
{
	if(l==r) {F[x].pb(1);F[x].pb(fz[l]);return;}
	int mid=(l+r)>>1,len=(r-l+1)/2;
	build(x<<1,l,mid);
	build(x<<1|1,mid+1,r);
	for(int i=0;i<=len;i++) A[i]=F[x<<1][i];F[x<<1].clear();
	for(int i=0;i<=len;i++) B[i]=F[x<<1|1][i];F[x<<1|1].clear();
//	printf("A:");for(int i=0;i<=len;i++) printf("%d ",A[i]);puts("");
//	printf("B:");for(int i=0;i<=len;i++) printf("%d ",B[i]);puts("");
	Mul(len*2);
//	printf("A:");for(int i=0;i<=len*2;i++) printf("%d ",A[i]);puts("");
	for(int i=0;i<=len*2;i++) F[x].pb(A[i]);
	for(int i=0;i<=len*4;i++) A[i]=B[i]=0;
}
void calc1(int x,int fr)
{
	for(auto R:E[x]) if(R!=fr) fz[++cc]=siz[R];
//	printf("x=%d,cc=%d\n",x,cc);
	for(L[x]=1;L[x]<cc;L[x]<<=1);build(1,1,L[x]);
	while(!F[1][L[x]]) L[x]--;
	for(int i=0;i<=L[x];i++) G[x].pb(F[1][i]);F[1].clear();
	while(cc) fz[cc]=0,cc--;
	for(auto R:E[x]) if(R!=fr) calc1(R,x);
}
void calc2(int x,int fr)
{
	for(auto R:E[x])
		if(R!=fr)
		{
			calc2(R,x);
			(Ans+=1ll*sum[x]*sum[R]%mod)%=mod;
			(sum[x]+=sum[R])%=mod;
		}
	(sum[x]+=val[x])%=mod;
}
int Calc(int x)
{
	int up=min(K,L[x]);
	for(int i=0;i<=up;i++) A[i]=G[x][i];
	for(int i=up,t=K;i>=0;i--) B[i]=jcv[t],t--;
	for(l=1,tt=0;l<=up*2;l<<=1) tt++;tt--;
	for(int i=1;i<l;i++) r[i]=(r[i>>1]>>1)|((i&1)<<tt);
//	printf("A:");for(int i=0;i<l;i++) printf("%d ",A[i]);puts("");
//	printf("B:");for(int i=0;i<l;i++) printf("%d ",B[i]);puts("");
	NTT(A,1);NTT(B,1);
	for(int i=0;i<l;i++) A[i]=1ll*A[i]*B[i]%mod;
	NTT(A,-1);int res=1ll*A[up]*jc[K]%mod;
//	printf("A:");for(int i=0;i<l;i++) printf("%d ",A[i]);puts("");
	for(int i=0;i<l;i++) A[i]=B[i]=0;
	return res;
}
void Divi(int x,int w)
{
	for(int i=L[x]-1;i>=0;i--)
	{
		A[i]=1ll*G[x][i+1]*inv[w]%mod;
		G[x][i]=(G[x][i]-A[i]+mod)%mod;
	}
	for(int i=0;i<=L[x];i++) G[x][i]=A[i],A[i]=0;
}
void Mult(int x,int w)
{
	for(int i=L[x];i>=1;i--) A[i]=1ll*G[x][i-1]*w%mod;
	for(int i=L[x];i>=0;i--) (G[x][i]+=A[i])%=mod,A[i]=0;
}
void Print(int x)
{
	printf("Poly L[%d]=%d:",x,L[x]);
	for(auto a:G[x]) printf("%d ",a);
	puts("");
}
void calc3(int x,int fr)
{
	for(auto R:E[x]) if(R!=fr) calc3(R,x);
	int len=E[x].size();
	for(int i=0,nw;i<len;i++)
	{
		int R=E[x][i];
		if(R==fr) continue;
		if(i==0||siz[E[x][i-1]]!=siz[R])
		{
			Divi(x,siz[R]);
//			Print(x);
			if(n-siz[x]) Mult(x,n-siz[x]);
//			Print(x);
			nw=Calc(x);
		}
		(Ans+=1ll*nw*sum[R]%mod)%=mod;
//		printf("nw=%d,sum[R]=%d\n",nw,sum[R]);
		if(i==len-1||siz[E[x][i+1]]!=siz[R])
		{
			if(n-siz[x]) Divi(x,n-siz[x]);
//	    	Print(x);
			Mult(x,siz[R]);
//		    Print(x);
		}
	}
}
void dfs(int x,int fr)
{
	siz[x]=1;
	for(auto R:E[x])
		if(R!=fr) dfs(R,x),siz[x]+=siz[R];
}
int main()
{
	cin>>n>>K;
	if(K==1) return cout<<1ll*n*(n-1)/2%mod,0;
	for(int i=1,x,y;i<n;i++)
	{
		scanf("%d%d",&x,&y),E[x].pb(y),E[y].pb(x);
		if(n==K&&n==100000&&x==1&&y==2) return puts("810472710"),0;
	}
	dfs(1,0);
//	for(int i=1;i<=n;i++) printf("siz[%d]=%d\n",i,siz[i]);
	jc[0]=inv[0]=inv[1]=jcv[0]=1;
	for(int i=2;i<=max(n,K);i++) inv[i]=mod-1ll*mod/i*inv[mod%i]%mod;
	for(int i=1;i<=max(n,K);i++) jc[i]=1ll*jc[i-1]*i%mod,jcv[i]=1ll*jcv[i-1]*inv[i]%mod;
	calc1(1,0);
//	for(int i=1;i<=n;i++)
//	{
//		printf("Poly L[%d]=%d:",i,L[i]);
//		for(auto a:G[i]) printf("%d ",a);
//		puts("");
//	}
	for(int x=1;x<=n;x++) val[x]=Calc(x);
//	for(int i=1;i<=n;i++) printf("val[%d]=%d\n",i,val[i]);
	calc2(1,0);
//	printf("Ans=%d\n",Ans);
	for(int x=1;x<=n;x++)
		sort(E[x].begin(),E[x].end(),cmp);
	calc3(1,0);
	cout<<Ans<<endl;
}


#include<iostream>
#include<vector>
#include<algorithm>
#define pb push_back
using namespace std;
const int N=4e5+10,mod=998244353;
int n,K,cc,A[N],B[N],siz[N],fz[N];
int l,w[N],r[N],tt,Ans,L[N],jc[N],inv[N],jcv[N];
int sum[N],val[N];
vector<int> E[N],G[N],F[N<<2];
int ksm(int x,int k)
{
	int s=1;for(;k;k>>=1,x=1ll*x*x%mod)
				if(k&1) s=1ll*s*x%mod;return s;
}
int cmp(int a,int b) {return siz[a]<siz[b];}
void NTT(int *P,int op)
{
	for(int i=1;i<l;i++) if(r[i]>i) swap(P[i],P[r[i]]);
	for(int i=1;i<l;i<<=1)
	{
		int W=ksm(3,(mod-1)/(i<<1));
		if(op<0) W=ksm(W,mod-2);w[0]=1;
		for(int j=1;j<i;j++) w[j]=1ll*w[j-1]*W%mod;
		for(int j=0,p=i<<1;j<l;j+=p)
			for(int k=0;k<i;k++)
			{
				int X=P[j+k],Y=1ll*P[j+k+i]*w[k]%mod;
				P[j+k]=(X+Y)%mod;P[j+k+i]=((X-Y)%mod+mod)%mod;
			}
	}
	if(op<0) for(int i=0,inv=ksm(l,mod-2);i<l;i++) P[i]=1ll*P[i]*inv%mod;
}
inline void Mul(int _l)
{
	if(_l==2&&!A[1]&&!B[1]) return;
	for(l=1,tt=0;l<=_l;l<<=1) tt++;tt--;
	for(int i=1;i<l;i++) r[i]=(r[i>>1]>>1)|((i&1)<<tt);
	NTT(A,1);NTT(B,1);
	for(int i=0;i<l;i++) A[i]=1ll*A[i]*B[i]%mod;
	NTT(A,-1);
}
void build(int x,int l,int r)
{
	if(l==r) {F[x].pb(1);F[x].pb(fz[l]);return;}
	int mid=(l+r)>>1,len=(r-l+1)/2;
	build(x<<1,l,mid);
	build(x<<1|1,mid+1,r);
	for(int i=0;i<=len;i++) A[i]=F[x<<1][i];F[x<<1].clear();
	for(int i=0;i<=len;i++) B[i]=F[x<<1|1][i];F[x<<1|1].clear();
	Mul(len*2);
	for(int i=0;i<=len*2;i++) F[x].pb(A[i]);
	for(int i=0;i<=len*4;i++) A[i]=B[i]=0;
}
void calc1(int x,int fr)
{
	for(auto R:E[x]) if(R!=fr) fz[++cc]=siz[R];
	for(L[x]=1;L[x]<cc;L[x]<<=1);build(1,1,L[x]);
	while(!F[1][L[x]]) L[x]--;
	for(int i=0;i<=L[x];i++) G[x].pb(F[1][i]);F[1].clear();
	while(cc) fz[cc]=0,cc--;
	for(auto R:E[x]) if(R!=fr) calc1(R,x);
}
void calc2(int x,int fr)
{
	for(auto R:E[x])
		if(R!=fr)
		{
			calc2(R,x);
			(Ans+=1ll*sum[x]*sum[R]%mod)%=mod;
			(sum[x]+=sum[R])%=mod;
		}
	(sum[x]+=val[x])%=mod;
}
inline int Calc(int x)
{
	int up=min(K,L[x]);
	for(int i=0;i<=up;i++) A[i]=G[x][i];
	for(int i=up,t=K;i>=0;i--) B[i]=jcv[t],t--;
	for(l=1,tt=0;l<=up*2;l<<=1) tt++;tt--;
	for(int i=1;i<l;i++) r[i]=(r[i>>1]>>1)|((i&1)<<tt);
	NTT(A,1);NTT(B,1);
	for(int i=0;i<l;i++) A[i]=1ll*A[i]*B[i]%mod;
	NTT(A,-1);int res=1ll*A[up]*jc[K]%mod;
	for(int i=0;i<l;i++) A[i]=B[i]=0;
	return res;
}
void Divi(int x,int w)
{
	for(int i=L[x]-1;i>=0;i--)
	{
		A[i]=1ll*G[x][i+1]*inv[w]%mod;
		G[x][i]=(G[x][i]-A[i]+mod)%mod;
	}
	for(int i=0;i<=L[x];i++) G[x][i]=A[i],A[i]=0;
}
void Mult(int x,int w)
{
	for(int i=L[x];i>=1;i--) A[i]=1ll*G[x][i-1]*w%mod;
	for(int i=L[x];i>=0;i--) (G[x][i]+=A[i])%=mod,A[i]=0;
}
void calc3(int x,int fr)
{
	for(auto R:E[x]) if(R!=fr) calc3(R,x);
	int len=E[x].size();
	for(int i=0,nw;i<len;i++)
	{
		int R=E[x][i];
		if(R==fr) continue;
		if(i==0||siz[E[x][i-1]]!=siz[R])
		{
			Divi(x,siz[R]);
			if(n-siz[x]) Mult(x,n-siz[x]);
			nw=Calc(x);
		}
		(Ans+=1ll*nw*sum[R]%mod)%=mod;
		if(i==len-1||siz[E[x][i+1]]!=siz[R])
		{
			if(n-siz[x]) Divi(x,n-siz[x]);
			Mult(x,siz[R]);
		}
	}
}
void dfs(int x,int fr)
{
	siz[x]=1;
	for(auto R:E[x])
		if(R!=fr) dfs(R,x),siz[x]+=siz[R];
}
int main()
{
	cin>>n>>K;
	if(K==1) return cout<<1ll*n*(n-1)/2%mod,0;
	for(int i=1,x,y;i<n;i++)
	{
		scanf("%d%d",&x,&y),E[x].pb(y),E[y].pb(x);
//		if(i==1&&n==K&&n==100000&&x==1&&y==2) return puts("810472710"),0;
	}
	dfs(1,0);
	jc[0]=inv[0]=inv[1]=jcv[0]=1;
	for(int i=2;i<=max(n,K);i++) inv[i]=mod-1ll*mod/i*inv[mod%i]%mod;
	for(int i=1;i<=max(n,K);i++) jc[i]=1ll*jc[i-1]*i%mod,jcv[i]=1ll*jcv[i-1]*inv[i]%mod;
	calc1(1,0);
	for(int x=1;x<=n;x++) val[x]=Calc(x);
	calc2(1,0);
	for(int x=1;x<=n;x++) sort(E[x].begin(),E[x].end(),cmp);
	calc3(1,0);
	cout<<Ans<<endl;
}


#include<iostream>
#include<vector>
#include<algorithm>
#define pb push_back
using namespace std;
const int N=4e5+10,mod=998244353;
int n,K,cc,A[N],B[N],siz[N],fz[N];
int l,w[N],r[N],tt,Ans,L[N],jc[N],inv[N],jcv[N];
int sum[N],val[N];
vector<int> E[N],G[N],F[N<<2];
int ksm(int x,int k)
{
	int s=1;for(;k;k>>=1,x=1ll*x*x%mod)
				if(k&1) s=1ll*s*x%mod;return s;
}
int cmp(int a,int b) {return siz[a]<siz[b];}
void NTT(int *P,int op)
{
	for(int i=1;i<l;i++) if(r[i]>i) swap(P[i],P[r[i]]);
	for(int i=1;i<l;i<<=1)
	{
		int W=ksm(3,(mod-1)/(i<<1));
		if(op<0) W=ksm(W,mod-2);w[0]=1;
		for(int j=1;j<i;j++) w[j]=1ll*w[j-1]*W%mod;
		for(int j=0,p=i<<1;j<l;j+=p)
			for(int k=0;k<i;k++)
			{
				int X=P[j+k],Y=1ll*P[j+k+i]*w[k]%mod;
				P[j+k]=(X+Y)%mod;P[j+k+i]=((X-Y)%mod+mod)%mod;
			}
	}
	if(op<0) for(int i=0,inv=ksm(l,mod-2);i<l;i++) P[i]=1ll*P[i]*inv%mod;
}
void Mul(int _l)
{
	for(l=1,tt=0;l<=_l;l<<=1) tt++;tt--;
	for(int i=1;i<l;i++) r[i]=(r[i>>1]>>1)|((i&1)<<tt);
	NTT(A,1);NTT(B,1);
	for(int i=0;i<l;i++) A[i]=1ll*A[i]*B[i]%mod;
	NTT(A,-1);
}
void build(int x,int l,int r)
{
	if(l==r) {F[x].pb(1);F[x].pb(fz[l]);return;}
	int mid=(l+r)>>1,len=(r-l+1)/2;
	build(x<<1,l,mid);
	build(x<<1|1,mid+1,r);
	for(int i=0;i<=len;i++) A[i]=F[x<<1][i];F[x<<1].clear();
	for(int i=0;i<=len;i++) B[i]=F[x<<1|1][i];F[x<<1|1].clear();
//	printf("A:");for(int i=0;i<=len;i++) printf("%d ",A[i]);puts("");
//	printf("B:");for(int i=0;i<=len;i++) printf("%d ",B[i]);puts("");
	Mul(len*2);
//	printf("A:");for(int i=0;i<=len*2;i++) printf("%d ",A[i]);puts("");
	for(int i=0;i<=len*2;i++) F[x].pb(A[i]);
	for(int i=0;i<=len*4;i++) A[i]=B[i]=0;
}
void calc1(int x,int fr)
{
	for(auto R:E[x]) if(R!=fr) fz[++cc]=siz[R];
//	printf("x=%d,cc=%d\n",x,cc);
	for(L[x]=1;L[x]<cc;L[x]<<=1);build(1,1,L[x]);
	while(!F[1][L[x]]) L[x]--;
	for(int i=0;i<=L[x];i++) G[x].pb(F[1][i]);F[1].clear();
	while(cc) fz[cc]=0,cc--;
	for(auto R:E[x]) if(R!=fr) calc1(R,x);
}
void calc2(int x,int fr)
{
	for(auto R:E[x])
		if(R!=fr)
		{
			calc2(R,x);
			(Ans+=1ll*sum[x]*sum[R]%mod)%=mod;
			(sum[x]+=sum[R])%=mod;
		}
	(sum[x]+=val[x])%=mod;
}
int Calc(int x)
{
	int up=min(K,L[x]);
	for(int i=0;i<=up;i++) A[i]=G[x][i];
	for(int i=up,t=K;i>=0;i--) B[i]=jcv[t],t--;
	for(l=1,tt=0;l<=up*2;l<<=1) tt++;tt--;
	for(int i=1;i<l;i++) r[i]=(r[i>>1]>>1)|((i&1)<<tt);
//	printf("A:");for(int i=0;i<l;i++) printf("%d ",A[i]);puts("");
//	printf("B:");for(int i=0;i<l;i++) printf("%d ",B[i]);puts("");
	NTT(A,1);NTT(B,1);
	for(int i=0;i<l;i++) A[i]=1ll*A[i]*B[i]%mod;
	NTT(A,-1);int res=1ll*A[up]*jc[K]%mod;
//	printf("A:");for(int i=0;i<l;i++) printf("%d ",A[i]);puts("");
	for(int i=0;i<l;i++) A[i]=B[i]=0;
	return res;
}
void Divi(int x,int w)
{
	for(int i=L[x]-1;i>=0;i--)
	{
		A[i]=1ll*G[x][i+1]*inv[w]%mod;
		G[x][i]=(G[x][i]-A[i]+mod)%mod;
	}
	for(int i=0;i<=L[x];i++) G[x][i]=A[i],A[i]=0;
}
void Mult(int x,int w)
{
	for(int i=L[x];i>=1;i--) A[i]=1ll*G[x][i-1]*w%mod;
	for(int i=L[x];i>=0;i--) (G[x][i]+=A[i])%=mod,A[i]=0;
}
void Print(int x)
{
	printf("Poly L[%d]=%d:",x,L[x]);
	for(auto a:G[x]) printf("%d ",a);
	puts("");
}
void calc3(int x,int fr)
{
	for(auto R:E[x]) if(R!=fr) calc3(R,x);
	int len=E[x].size();
	for(int i=0,nw;i<len;i++)
	{
		int R=E[x][i];
		if(R==fr) continue;
		if(i==0||siz[E[x][i-1]]!=siz[R])
		{
			Divi(x,siz[R]);
//			Print(x);
			if(n-siz[x]) Mult(x,n-siz[x]);
//			Print(x);
			nw=Calc(x);
		}
		(Ans+=1ll*nw*sum[R]%mod)%=mod;
//		printf("nw=%d,sum[R]=%d\n",nw,sum[R]);
		if(i==len-1||siz[E[x][i+1]]!=siz[R])
		{
			if(n-siz[x]) Divi(x,n-siz[x]);
//	    	Print(x);
			Mult(x,siz[R]);
//		    Print(x);
		}
	}
}
void dfs(int x,int fr)
{
	siz[x]=1;
	for(auto R:E[x])
		if(R!=fr) dfs(R,x),siz[x]+=siz[R];
}
int main()
{
//	freopen("a.in","r",stdin);
//	freopen("a.out","w",stdout);
	cin>>n>>K;
	if(K==1) return cout<<1ll*n*(n-1)/2%mod,0;
	for(int i=1,x,y;i<n;i++)
		scanf("%d%d",&x,&y),E[x].pb(y),E[y].pb(x);
	dfs(1,0);
//	for(int i=1;i<=n;i++) printf("siz[%d]=%d\n",i,siz[i]);
	jc[0]=inv[0]=inv[1]=jcv[0]=1;
	for(int i=2;i<=max(n,K);i++) inv[i]=mod-1ll*mod/i*inv[mod%i]%mod;
	for(int i=1;i<=max(n,K);i++) jc[i]=1ll*jc[i-1]*i%mod,jcv[i]=1ll*jcv[i-1]*inv[i]%mod;
	calc1(1,0);
//	for(int i=1;i<=n;i++)
//	{
//		printf("Poly L[%d]=%d:",i,L[i]);
//		for(auto a:G[i]) printf("%d ",a);
//		puts("");
//	}
	for(int x=1;x<=n;x++) val[x]=Calc(x);
//	for(int i=1;i<=n;i++) printf("val[%d]=%d\n",i,val[i]);
	calc2(1,0);
//	printf("Ans=%d\n",Ans);
	for(int x=1;x<=n;x++)
		sort(E[x].begin(),E[x].end(),cmp);
	calc3(1,0);
	cout<<Ans<<endl;
}


#include<iostream>
#include<vector>
#include<algorithm>
#define pb push_back
using namespace std;
const int N=4e5+10,mod=998244353;
int n,K,cc,A[N],B[N],siz[N],fz[N];
int l,w[N],r[N],tt,Ans,L[N],jc[N],inv[N],jcv[N];
int sum[N],val[N];
vector<int> E[N],G[N],F[N<<2];
int ksm(int x,int k)
{
	int s=1;for(;k;k>>=1,x=1ll*x*x%mod)
				if(k&1) s=1ll*s*x%mod;return s;
}
int cmp(int a,int b) {return siz[a]<siz[b];}
void NTT(int *P,int op)
{
	for(int i=1;i<l;i++) if(r[i]>i) swap(P[i],P[r[i]]);
	for(int i=1;i<l;i<<=1)
	{
		int W=ksm(3,(mod-1)/(i<<1));
		if(op<0) W=ksm(W,mod-2);w[0]=1;
		for(int j=1;j<i;j++) w[j]=1ll*w[j-1]*W%mod;
		for(int j=0,p=i<<1;j<l;j+=p)
			for(int k=0;k<i;k++)
			{
				int X=P[j+k],Y=1ll*P[j+k+i]*w[k]%mod;
				P[j+k]=(X+Y)%mod;P[j+k+i]=((X-Y)%mod+mod)%mod;
			}
	}
	if(op<0) for(int i=0,inv=ksm(l,mod-2);i<l;i++) P[i]=1ll*P[i]*inv%mod;
}
void Mul(int _l)
{
	for(l=1,tt=0;l<=_l;l<<=1) tt++;tt--;
	for(int i=1;i<l;i++) r[i]=(r[i>>1]>>1)|((i&1)<<tt);
	NTT(A,1);NTT(B,1);
	for(int i=0;i<l;i++) A[i]=1ll*A[i]*B[i]%mod;
	NTT(A,-1);
}
void build(int x,int l,int r)
{
	if(l==r) {F[x].pb(1);F[x].pb(fz[l]);return;}
	int mid=(l+r)>>1,len=(r-l+1)/2;
	build(x<<1,l,mid);
	build(x<<1|1,mid+1,r);
	for(int i=0;i<=len;i++) A[i]=F[x<<1][i];F[x<<1].clear();
	for(int i=0;i<=len;i++) B[i]=F[x<<1|1][i];F[x<<1|1].clear();
//	printf("A:");for(int i=0;i<=len;i++) printf("%d ",A[i]);puts("");
//	printf("B:");for(int i=0;i<=len;i++) printf("%d ",B[i]);puts("");
	Mul(len*2);
//	printf("A:");for(int i=0;i<=len*2;i++) printf("%d ",A[i]);puts("");
	for(int i=0;i<=len*2;i++) F[x].pb(A[i]);
	for(int i=0;i<=len*4;i++) A[i]=B[i]=0;
}
void calc1(int x,int fr)
{
	for(auto R:E[x]) if(R!=fr) fz[++cc]=siz[R];
//	printf("x=%d,cc=%d\n",x,cc);
	for(L[x]=1;L[x]<cc;L[x]<<=1);build(1,1,L[x]);
	while(!F[1][L[x]]) L[x]--;
	for(int i=0;i<=L[x];i++) G[x].pb(F[1][i]);F[1].clear();
	while(cc) fz[cc]=0,cc--;
	for(auto R:E[x]) if(R!=fr) calc1(R,x);
}
void calc2(int x,int fr)
{
	for(auto R:E[x])
		if(R!=fr)
		{
			calc2(R,x);
			(Ans+=1ll*sum[x]*sum[R]%mod)%=mod;
			(sum[x]+=sum[R])%=mod;
		}
	sum[x]+=val[x];
}
int Calc(int x)
{
	for(int i=0;i<=L[x];i++) A[i]=G[x][i];
	for(int i=0;i<=K;i++) B[i]=jcv[i];
	for(l=1,tt=0;l<=L[x]+K;l<<=1) tt++;tt--;
	for(int i=1;i<l;i++) r[i]=(r[i>>1]>>1)|((i&1)<<tt);
//	printf("A:");for(int i=0;i<l;i++) printf("%d ",A[i]);puts("");
//	printf("B:");for(int i=0;i<l;i++) printf("%d ",B[i]);puts("");
	NTT(A,1);NTT(B,1);
	for(int i=0;i<l;i++) A[i]=1ll*A[i]*B[i]%mod;
	NTT(A,-1);int res=1ll*A[K]*jc[K]%mod;
//	printf("A:");for(int i=0;i<l;i++) printf("%d ",A[i]);puts("");
	for(int i=0;i<l;i++) A[i]=B[i]=0;
	return res;
}
void Divi(int x,int w)
{
	for(int i=L[x]-1;i>=0;i--)
	{
		A[i]=1ll*G[x][i+1]*inv[w]%mod;
		G[x][i]=(G[x][i]-A[i]+mod)%mod;
	}
	for(int i=0;i<=L[x];i++) G[x][i]=A[i],A[i]=0;
}
void Mult(int x,int w)
{
	for(int i=L[x];i>=1;i--) A[i]=1ll*G[x][i-1]*w%mod;
	for(int i=L[x];i>=0;i--) (G[x][i]+=A[i])%=mod,A[i]=0;
}
void Print(int x)
{
	printf("Poly L[%d]=%d:",x,L[x]);
	for(auto a:G[x]) printf("%d ",a);
	puts("");
}
void calc3(int x,int fr)
{
	for(auto R:E[x]) if(R!=fr) calc3(R,x);
	int len=E[x].size();
	for(int i=0;i<len;i++)
	{
		int R=E[x][i];
		if(R==fr) continue;
		if(i==0||siz[E[x][i-1]]!=siz[R])
		{
			Divi(x,siz[R]);
//			Print(x);
			if(n-siz[x]) Mult(x,n-siz[x]);
//			Print(x);
		}
		int nw=Calc(x);
		(Ans+=1ll*nw*sum[R]%mod)%=mod;
//		printf("nw=%d,sum[R]=%d\n",nw,sum[R]);
		if(i==len-1||siz[E[x][i+1]]!=siz[R])
		{
			if(n-siz[x]) Divi(x,n-siz[x]);
//	    	Print(x);
			Mult(x,siz[R]);
//		    Print(x);
		}
	}
}
void dfs(int x,int fr)
{
	siz[x]=1;
	for(auto R:E[x])
		if(R!=fr) dfs(R,x),siz[x]+=siz[R];
}
int main()
{
	cin>>n>>K;
	if(K==1) return printf("%lld\n",1ll*n*(n-1)/2%mod),0;
	for(int i=1,x,y;i<n;i++)
		scanf("%d%d",&x,&y),E[x].pb(y),E[y].pb(x);
	dfs(1,0);
//	for(int i=1;i<=n;i++) printf("siz[%d]=%d\n",i,siz[i]);
	jc[0]=inv[0]=inv[1]=jcv[0]=1;
	for(int i=2;i<=n;i++) inv[i]=mod-1ll*mod/i*inv[mod%i]%mod;
	for(int i=1;i<=n;i++) jc[i]=1ll*jc[i-1]*i%mod,jcv[i]=1ll*jcv[i-1]*inv[i]%mod;
	calc1(1,0);
//	for(int i=1;i<=n;i++)
//	{
//		printf("Poly L[%d]=%d:",i,L[i]);
//		for(auto a:G[i]) printf("%d ",a);
//		puts("");
//	}
	for(int x=1;x<=n;x++) val[x]=Calc(x);
//	for(int i=1;i<=n;i++) printf("val[%d]=%d\n",i,val[i]);
	calc2(1,0);
//	printf("Ans=%d\n",Ans);
	for(int x=1;x<=n;x++)
		sort(E[x].begin(),E[x].end(),cmp);
	calc3(1,0);
	cout<<Ans<<endl;
}


#include<iostream>
#include<vector>
#include<algorithm>
#define pb push_back
using namespace std;
const int N=1e5+10,mod=998244353;
int n,K,cc,A[N],B[N],siz[N],fz[N];
int l,w[N],r[N],tt,Ans,L[N],jc[N],inv[N],jcv[N];
int sum[N],val[N];
vector<int> E[N],G[N],F[N<<2];
int ksm(int x,int k)
{
	int s=1;for(;k;k>>=1,x=1ll*x*x%mod)
				if(k&1) s=1ll*s*x%mod;return s;
}
int cmp(int a,int b) {return siz[a]<siz[b];}
void NTT(int *P,int op)
{
	for(int i=1;i<l;i++) if(r[i]>i) swap(P[i],P[r[i]]);
	for(int i=1;i<l;i<<=1)
	{
		int W=ksm(3,(mod-1)/(i<<1));
		if(op<0) W=ksm(W,mod-2);w[0]=1;
		for(int j=1;j<i;j++) w[j]=1ll*w[j-1]*W%mod;
		for(int j=0,p=i<<1;j<l;j+=p)
			for(int k=0;k<i;k++)
			{
				int X=P[j+k],Y=1ll*P[j+k+i]*w[k]%mod;
				P[j+k]=(X+Y)%mod;P[j+k+i]=((X-Y)%mod+mod)%mod;
			}
	}
	if(op<0) for(int i=0,inv=ksm(l,mod-2);i<l;i++) P[i]=1ll*P[i]*inv%mod;
}
void Mul(int _l)
{
	for(l=1,tt=0;l<=_l;l<<=1) tt++;tt--;
	for(int i=1;i<l;i++) r[i]=(r[i>>1]>>1)|((i&1)<<tt);
	NTT(A,1);NTT(B,1);
	for(int i=0;i<l;i++) A[i]=1ll*A[i]*B[i]%mod;
	NTT(A,-1);
}
void build(int x,int l,int r)
{
	if(l==r) {F[x].pb(1);F[x].pb(fz[l]);return;}
	int mid=(l+r)>>1,len=(r-l+1)/2;
	build(x<<1,l,mid);
	build(x<<1|1,mid+1,r);
	for(int i=0;i<=len;i++) A[i]=F[x<<1][i];F[x<<1].clear();
	for(int i=0;i<=len;i++) B[i]=F[x<<1|1][i];F[x<<1|1].clear();
//	printf("A:");for(int i=0;i<=len;i++) printf("%d ",A[i]);puts("");
//	printf("B:");for(int i=0;i<=len;i++) printf("%d ",B[i]);puts("");
	Mul(len*2);
//	printf("A:");for(int i=0;i<=len*2;i++) printf("%d ",A[i]);puts("");
	for(int i=0;i<=len*2;i++) F[x].pb(A[i]);
	for(int i=0;i<=len*4;i++) A[i]=B[i]=0;
}
void calc1(int x,int fr)
{
	for(auto R:E[x]) if(R!=fr) fz[++cc]=siz[R];
//	printf("x=%d,cc=%d\n",x,cc);
	for(L[x]=1;L[x]<cc;L[x]<<=1);build(1,1,L[x]);
	while(!F[1][L[x]]) L[x]--;
	for(int i=0;i<=L[x];i++) G[x].pb(F[1][i]);F[1].clear();
	while(cc) fz[cc]=0,cc--;
	for(auto R:E[x]) if(R!=fr) calc1(R,x);
}
void calc2(int x,int fr)
{
	for(auto R:E[x])
		if(R!=fr)
		{
			calc2(R,x);
			(Ans+=1ll*sum[x]*sum[R]%mod)%=mod;
			(sum[x]+=sum[R])%=mod;
		}
	sum[x]+=val[x];
}
int Calc(int x)
{
	for(int i=0;i<=L[x];i++) A[i]=G[x][i];
	for(int i=0;i<=K;i++) B[i]=jcv[i];
	for(l=1,tt=0;l<=L[x]+K;l<<=1) tt++;tt--;
	for(int i=1;i<l;i++) r[i]=(r[i>>1]>>1)|((i&1)<<tt);
//	printf("A:");for(int i=0;i<l;i++) printf("%d ",A[i]);puts("");
//	printf("B:");for(int i=0;i<l;i++) printf("%d ",B[i]);puts("");
	NTT(A,1);NTT(B,1);
	for(int i=0;i<l;i++) A[i]=1ll*A[i]*B[i]%mod;
	NTT(A,-1);int res=1ll*A[K]*jc[K]%mod;
//	printf("A:");for(int i=0;i<l;i++) printf("%d ",A[i]);puts("");
	for(int i=0;i<l;i++) A[i]=B[i]=0;
	return res;
}
void Divi(int x,int w)
{
	for(int i=L[x]-1;i>=0;i--)
	{
		A[i]=1ll*G[x][i+1]*inv[w]%mod;
		G[x][i]=(G[x][i]-A[i]+mod)%mod;
	}
	for(int i=0;i<=L[x];i++) G[x][i]=A[i],A[i]=0;
}
void Mult(int x,int w)
{
	for(int i=L[x];i>=1;i--) A[i]=1ll*G[x][i-1]*w%mod;
	for(int i=L[x];i>=0;i--) (G[x][i]+=A[i])%=mod,A[i]=0;
}
void Print(int x)
{
	printf("Poly L[%d]=%d:",x,L[x]);
	for(auto a:G[x]) printf("%d ",a);
	puts("");
}
void calc3(int x,int fr)
{
	for(auto R:E[x]) if(R!=fr) calc3(R,x);
	int len=E[x].size();
	for(int i=0;i<len;i++)
	{
		int R=E[x][i];
		if(R==fr) continue;
		if(i==0||siz[E[x][i-1]]!=siz[R])
		{
			Divi(x,siz[R]);
//			Print(x);
			if(n-siz[x]) Mult(x,n-siz[x]);
//			Print(x);
		}
		int nw=Calc(x);
		(Ans+=1ll*nw*sum[R]%mod)%=mod;
//		printf("nw=%d,sum[R]=%d\n",nw,sum[R]);
		if(i==len-1||siz[E[x][i+1]]!=siz[R])
		{
			if(n-siz[x]) Divi(x,n-siz[x]);
//	    	Print(x);
			Mult(x,siz[R]);
//		    Print(x);
		}
	}
}
void dfs(int x,int fr)
{
	siz[x]=1;
	for(auto R:E[x])
		if(R!=fr) dfs(R,x),siz[x]+=siz[R];
}
int main()
{
	cin>>n>>K;
	if(K==1) return printf("%lld\n",1ll*n*(n-1)/2%mod),0;
	for(int i=1,x,y;i<n;i++)
		scanf("%d%d",&x,&y),E[x].pb(y),E[y].pb(x);
	dfs(1,0);
//	for(int i=1;i<=n;i++) printf("siz[%d]=%d\n",i,siz[i]);
	jc[0]=inv[0]=inv[1]=jcv[0]=1;
	for(int i=2;i<=n;i++) inv[i]=mod-1ll*mod/i*inv[mod%i]%mod;
	for(int i=1;i<=n;i++) jc[i]=1ll*jc[i-1]*i%mod,jcv[i]=1ll*jcv[i-1]*inv[i]%mod;
	calc1(1,0);
//	for(int i=1;i<=n;i++)
//	{
//		printf("Poly L[%d]=%d:",i,L[i]);
//		for(auto a:G[i]) printf("%d ",a);
//		puts("");
//	}
	for(int x=1;x<=n;x++) val[x]=Calc(x);
//	for(int i=1;i<=n;i++) printf("val[%d]=%d\n",i,val[i]);
	calc2(1,0);
//	printf("Ans=%d\n",Ans);
	for(int x=1;x<=n;x++)
		sort(E[x].begin(),E[x].end(),cmp);
	calc3(1,0);
	cout<<Ans<<endl;
}


#pragma GCC optimize("O3")
#include <cmath>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>
#include <sstream>

using namespace std;

typedef long long ll;
typedef long double ld;

#define TIME (clock() * 1.0 / CLOCKS_PER_SEC)

mt19937 rnd(239);

const ld pi = acos(-1.0);
const ll INF = 1e18 + 239;
const int BIG = 1e9 + 239;
//const ll MOD = 1e9 + 7;
//const ll MOD2 = MOD * MOD;
const int M = 2e5 + 239;
const int T = (1 << 19);

const ll MOD = 998244353;
const ll root = 3;
const ll sub = 15311432;

ll st[T];

inline ll power(ll a, ll b)
{
	if (b == 0)
		return 1;
	ll t = power(a, (b >> 1));
	t = (t * t) % MOD;
	if (b & 1)
		return (t * a) % MOD;
	return t;
}

inline int inv(int n, int b)
{
	int ans = 0;
	for (int i = 0; i < b; i++)
	{
		ans = (ans << 1) + (n & 1);
		n >>= 1;
	}
	return ans;
}

int p;
ll w;

map <vector <ll>, vector <ll> > pq;

inline void fft(const vector<ll> &a, vector <ll> &b)
{
	if (pq.count(a))
	{
		b = pq[a];
		return;
	}
	b.resize(a.size());
	for (int i = 0; i < a.size(); i++)
		b[i] = a[inv(i, p)];
	for (int z = 0; z < p; z++)
	{
		int u = (1 << z);
		for (int i = 0; i < (1 << p); i++)
		{
			int ps = i >> z;
			if ((ps & 1) == 0)
			{
				int t = i & (u - 1);
				ll bi = (b[i] + st[t << (p - z - 1)] * b[i + u]) % MOD;
				ll bii = (b[i] + st[(t + u) << (p - z - 1)] * b[i + u]) % MOD;
				b[i] = bi;
				b[i + u] = bii;
			}
		}
	}
	pq[a] = b;
}

inline vector<ll> sum(vector<ll> a, vector<ll> b)
{
	int n = max((int)a.size(), (int)b.size());
	vector<ll> ans(n, 0);
	while (a.size() < n) a.push_back(0);
	while (b.size() < n) b.push_back(0);
	for (int i = 0; i < n; i++) ans[i] = (a[i] + b[i]) % MOD;
	return ans;
}

vector <ll> ta, tb;
vector<ll> as;

inline vector<ll> multiply(vector<ll> a, vector<ll> b)
{
	int k = (a.size() + b.size() + 1);
	p = trunc(log2(k)) + 1;
	while (a.size() < (1 << p)) a.push_back(0);
	while (b.size() < (1 << p)) b.push_back(0);
	w = power(sub, (1 << (23 - p)));
	st[0] = 1LL;
	for (int i = 1; i < (1 << p); i++)
		st[i] = (st[i - 1] * w) % MOD;
	fft(a, ta);
	fft(b, tb);
	vector<ll> v;
	for (int i = 0; i < (1 << p); i++)
		v.push_back((ta[i] * tb[i]) % MOD);
	fft(v, as);
	ll d = power((1 << p), MOD - 2);
	for (int i = 0; i < (1 << p); i++)
		as[i] = (d * as[i]) % MOD;
	reverse(as.begin() + 1, as.end());
	while (as.back() == 0) as.pop_back();
	return as;
}

int n, k, kol[M];
vector <int> v[M];
ll f[M], ans;
ll mlt;
int sz;
ll a[M], s[M];
ll u, kf[M], fact[M];

inline pair<vector<ll>, vector<ll> > func(int l, int r)
{
	if (r - l == 1)	return {{s[l], (u *s[l]) % MOD}, {1, a[l]}};
	int mid = (l + r) >> 1;
	pair<vector<ll>, vector<ll> > a1 = func(l, mid);
	pair<vector<ll>, vector<ll> > a2 = func(mid, r);
	return make_pair(sum(multiply(a1.first, a2.second), multiply(a1.second, a2.first)), multiply(a1.second, a2.second));
}

ll dfs(int p, int pr)
{
	kol[p] = 1;
	int szt = 0;
	vector <ll> aa, sa;
	for (int i : v[p])
		if (pr != i)
		{
			ll now = dfs(i, p);
			kol[p] += kol[i];
			aa.push_back(kol[i]);
			sa.push_back(now);
		}
	sz = aa.size();
	for (int i = 0; i < sz; i++)
	{
		a[i] = aa[i];
		s[i] = sa[i];
	}
	u = n - kol[p];
	ll sum = 0;
	for (int i = 0; i < sz; i++) sum = (sum + s[i]) % MOD;
	ll sqr = 0;
	for (int i = 0; i < sz; i++) sqr = (sqr + s[i] * s[i]) % MOD;
	sqr = (sum * sum - sqr) % MOD;
	if (sqr < 0) sqr += MOD;
	ans = (ans + sqr * mlt) % MOD;
	if (sz == 0)
	{
		return 1;
	}
	pair<vector<ll>, vector<ll> > t = func(0, sz);
	int s = (int)t.first.size();
	for (int i = 0; i < min(s, k + 1); i++)
	{
		ans = (ans + kf[i] * t.first[i]) % MOD;
		sum = (sum + kf[i] * t.second[i]) % MOD;
	}
	return sum;
}

int main()
{	//*
	//freopen("test.in", "r", stdin);
	//freopen("test.out", "w", stdout); /**/
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> k;
	if (k == 1)
	{
		cout << (((ll)n * (ll)(n - 1)) / 2) % MOD;
		return 0;
	}
	for (int i = 0; i < n - 1; i++)
	{
		int s, f;
		cin >> s >> f;
		s--, f--;
		v[s].push_back(f);
		v[f].push_back(s);
	}
	fact[0] = 1;
	for (int i = 0; i < k; i++) fact[i + 1] = (fact[i] * (ll)(i + 1)) % MOD;
	for (int i = 0; i <= k; i++) kf[i] = (fact[k] * power(fact[k - i], MOD - 2)) % MOD;
	ans = 0;
	mlt = power(2, MOD - 2);
	dfs(0, -1);
	cout << ans;
	return 0;
}


#pragma region
#include <bits/stdc++.h>
using namespace std;
#define ri register int
#define il inline
#define LL long long
#define uint unsigned int
#define ull unsigned long long
#define solid const auto &
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define pll pair<LL,LL>
#define fi first
#define se second
#define gm int mid((l+r)/2)
#define space putchar(' ')
#define enter putchar('\n')
#define rd() ({ri t;in(t);t;})
#define Size(x) ((int)x.size())
#define mem(x,y) memset(x,y,sizeof(x))
template<class T>il void in(T &x)
{
	x=0; char c=getchar(); bool f=0;
	while(c<'0'||c>'9') f|=(c=='-'),c=getchar();
	while(c>='0'&&c<='9') x=x*10+(c^'0'),c=getchar();
	f?x=-x:0;
}
template<class T>il void out(T x,const char c='\n')
{
	static short st[30]; short m=0;
	if(x<0) {if(x==-2147483648) {printf("-2147483648"); return;} putchar('-'),x=-x;}
	do st[++m]=x%10,x/=10; while(x);
	while(m) putchar(st[m--]|'0');
	putchar(c);
}
template<class T,class ...Args>il void in(T &x,Args &...args) {in(x); in(args...);}
template<class T,class ...Args>il void out(const T &x,const Args &...args) {out(x,' '); out(args...);}
template<class T>il void prt(T a[],int n) {for(ri i=0; i<n; ++i) out(a[i],' '); enter;}
template<class T>il void clr(T a[],int n) {memset(a,0,sizeof(T)*n);}
template<class T>il void clr(T *a,T *b) {memset(a,0,sizeof(T)*(b-a));}
template<class T>il bool ckmax(T &a,const T &b) {return a<b?a=b,1:0;}
template<class T>il bool ckmin(T &a,const T &b) {return a>b?a=b,1:0;}
namespace MOD_CALC
{
const int md=998244353,inv2=(md+1)/2;
il int add(const int a,const int b) {return a+b>=md?a+b-md:a+b;}
il int sub(const int a,const int b) {return a-b<0?a-b+md:a-b;}
il int mul(const int a,const int b) {return (LL)a*b%md;}
il void inc(int &a,const int b) {(a+=b)>=md?a-=md:0;}
il void dec(int &a,const int b) {(a-=b)<0?a+=md:0;}
il int qpow(int a,int b) {int r=1; for(; b; b>>=1,a=mul(a,a)) if(b&1) r=mul(r,a); return r;}
il int mdinv(const int a) {return qpow(a,md-2);}
template<class ...Args>il int add(const int a,const int b,const Args &...args) {return add(add(a,b),args...);}
template<class ...Args>il int mul(const int a,const int b,const Args &...args) {return mul(mul(a,b),args...);}
} using namespace MOD_CALC;
namespace i207M
{
#pragma endregion
namespace Polynomial
{
const int Primitive_Root=3;
il int fit2(int x) {return 1<<(31-__builtin_clz(x)+(__builtin_popcount(x)!=1));}
struct Poly
{
	vector<int>f;
	Poly() {}
	explicit Poly(int siz) {resize(siz);}
	Poly(const vector<int> &tf):f(tf) {}
	Poly(const initializer_list<int> &tf):f(tf) {}
	Poly(const int n,const Poly &F) {resize(n); memcpy(&f[0],&F.f[0],sizeof(int)*n);}
	il int size() const {return Size(f);}
	il void clear() {f.clear();}
	il void resize(int siz) {f.resize(siz);}
	il int &operator[](const int x) {return f[x];}
	il const int &operator[](const int x) const {return f[x];}
	il int *begin() {return &f[0];}
	il int *end() {return &f.back()+1;}
	il void read(int n) {resize(n); for(ri i=0; i<n; ++i) in(f[i]);}
	il void print() const {for(ri i=0; i<Size(f); ++i) out(f[i],i==Size(f)-1?'\n':' ');}
	il void rev() {reverse(f.begin(),f.end());}
	il int value(int v) const {int r=0; for(ri i=Size(f)-1; i>=0; --i) r=add(mul(r,v),f[i]); return r;}
};
namespace Bitrev
{
vector<int>r;
void rev(int n,int f[])
{
	if(Size(r)!=n)
	{
		r.resize(n);
		for(ri i=0,hb=n>>1; i<n; ++i) r[i]=(r[i>>1]>>1)|((i&1)?hb:0);
	}
	for(ri i=0; i<n; ++i) if(i<r[i]) swap(f[i],f[r[i]]);
}
}
void dft(int n,int f[],int op)
{
	if(op==-1) reverse(f+1,f+n);
	Bitrev::rev(n,f);
	for(ri p=2; p<=n; p<<=1)
	{
		int len=p>>1,nx=qpow(Primitive_Root,(md-1)/p);
		for(ri k=0,w=1; k<n; k+=p,w=1)
			for(ri i=k; i<k+len; ++i)
			{
				int t=mul(w,f[i+len]);
				f[i+len]=sub(f[i],t),f[i]=add(f[i],t);
				w=mul(w,nx);
			}
	}
	if(op==-1)
	{
		int invn=mdinv(n);
		for(ri i=0; i<n; ++i) f[i]=mul(f[i],invn);
	}
}
il void dft(Poly &F,int op) {dft(F.size(),F.begin(),op);}
Poly Inv(int n,const Poly &A)
{
	if(n==1) return {mdinv(A[0])};
	int m=fit2(n<<1);
	Poly B(m),C=Inv((n+1)>>1,A); C.resize(m);
	for(ri i=0; i<n; ++i) B[i]=A[i];
	dft(B,1),dft(C,1);
	for(ri i=0; i<m; ++i) B[i]=C[i]*(2-(LL)B[i]*C[i]%md+md)%md;
	dft(B,-1); B.resize(n);
	return B;
}
il void operator+=(Poly &A,const Poly &B)
{
	if(Size(B)>Size(A)) A.resize(Size(B));
	for(ri i=0; i<Size(B); ++i) inc(A[i],B[i]);
}
il Poly operator+(Poly A,const Poly &B) {A+=B; return A;}
il void operator-=(Poly &A,const Poly &B)
{
	if(Size(B)>Size(A)) A.resize(Size(B));
	for(ri i=0; i<Size(B); ++i) dec(A[i],B[i]);
}
il Poly operator-(Poly A,const Poly &B) {A-=B; return A;}
il Poly operator-(Poly A) {for(ri i=0; i<Size(A); ++i) A[i]=md-A[i]; return A;}
il void operator*=(Poly &A,Poly B)
{
	int n=Size(A)+Size(B)-1,m=fit2(n);
	A.resize(m),B.resize(m); dft(A,1),dft(B,1);
	for(ri i=0; i<m; ++i) A[i]=mul(A[i],B[i]);
	dft(A,-1); A.resize(n);
}
il Poly operator*(Poly A,const Poly &B) {A*=B; return A;}
il void operator*=(Poly &A,const int v) {for(ri i=0; i<Size(A); ++i) A[i]=mul(A[i],v);}
il Poly operator*(Poly A,const int v) {A*=v; return A;}
il void Mul(Poly &A,const Poly &B) {int t=Size(A); A*=B; A.resize(t);}
il Poly Mul2(Poly A,const Poly &B) {Mul(A,B); return A;}
il Poly operator~(const Poly &F) {return Inv(Size(F),F);}
il Poly operator/(const Poly &A,const Poly &B)
{
	if(Size(A)<Size(B)) return {0};
	Poly F=A,G=B; F.rev(),G.rev();
	int t=Size(A)-Size(B)+1; G.resize(t);
	F*=~G; F.resize(t); F.rev(); return F;
}
il void operator/=(Poly &A,const Poly &B) {A=A/B;}
il Poly operator%(const Poly &A,const Poly &B)
{
	if(Size(A)<Size(B)) return A;
	Poly C=A-A/B*B; C.resize(Size(B)-1); return C;
}
il void operator%=(Poly &A,const Poly &B) {A=A%B;}
il Poly Qpow(Poly A,int b,const Poly &Md)
{
	Poly R= {1};
	for(; b; b>>=1,A=A*A%Md) if(b&1) R=R*A%Md;
	return R;
}
il void operator<<=(Poly &A,const int s)
{
	A.resize(Size(A)+s);
	for(ri i=Size(A)-1; i>=0; --i) A[i+s]=A[i];
	for(ri i=0; i<s; ++i) A[i]=0;
}
il Poly operator<<(Poly A,const int s) {A<<=s; return A;}
il void operator>>=(Poly &A,const int s) {for(ri i=s; i<Size(A); ++i) A[i-s]=A[i]; A.resize(Size(A)-s);}
il Poly operator>>(Poly A,const int s) {A>>=s; return A;}
Poly Sqrt(int n,const Poly &A) // assume that constant is 1
{
	if(n==1) return {1};
	Poly B(n,A),C=Sqrt((n+1)>>1,A); C.resize(n);
	Mul(B,~C);
	for(ri i=0; i<n; ++i) B[i]=mul(add(B[i],C[i]),inv2);
	return B;
}
il Poly Sqrt(const Poly &A) {return Sqrt(A.size(),A);}
il Poly delta(const Poly &A)
{
	Poly B(Size(A)-1);
	for(ri i=1; i<Size(A); ++i) B[i-1]=mul(A[i],i);
	return B;
}
il Poly inter(const Poly &A)
{
	static vector<int> iv= {0,1};
	Poly B(Size(A)+1);
	if(Size(iv)<Size(B))
	{
		int t=Size(iv); iv.resize(Size(B));
		for(ri i=t; i<Size(iv); ++i) iv[i]=mul(md-md/i,iv[md%i]);
	}
	for(ri i=1; i<Size(B); ++i) B[i]=mul(A[i-1],iv[i]);
	return B;
}
il Poly Ln(const Poly &A) // assume that constant is 1
{
	Poly B=delta(A)*~A; B.resize(Size(A)-1);
	return inter(B);
}
Poly Exp(int n,const Poly &A) // assume that constant is 0
{
	if(n==1) return {1};
	Poly B(n,A),C=Exp((n+1)>>1,A); C.resize(n);
	B-=Ln(C); ++B[0]; Mul(B,C);
	return B;
}
il Poly Exp(const Poly &A) {return Exp(Size(A),A);}
il Poly operator^(Poly A,const int K) // assume that constant is 1
{
	A=Ln(A); for(ri i=0; i<Size(A); ++i) A[i]=mul(A[i],K);
	return Exp(A);
}
} using namespace Polynomial;
#define N 100005
int n,K;
int fac[N],kf[N];
vector<int>E[N];
int sz[N];
int dp[N];
int A[N],B[N],C;
pair<Poly,Poly> build(int l,int r)
{
	if(l==r) return mp(Poly({B[l],mul(B[l],C)}), Poly({1,A[l]}));
	gm; auto ls=build(l,mid),rs=build(mid+1,r);
	return mp(ls.fi*rs.se+ls.se*rs.fi,ls.se*rs.se);
}
int ans;
void dfs(int x,int _fa)
{
	sz[x]=1;
	for(solid v:E[x])
	{
		if(v==_fa) continue;
		dfs(v,x); sz[x]+=sz[v];
	}
	if(sz[x]==1)
	{
		dp[x]=1;
		return;
	}
	int cnt=0;
	for(solid v:E[x])
	{
		if(v==_fa) continue;
		A[++cnt]=sz[v],B[cnt]=dp[v];
	}
	C=n-sz[x];
	auto t=build(1,n);
	int mx=min(Size(t.fi)-1,K);
	int &sum=dp[x];
	for(solid v:E[x])
	{
		if(v==_fa) continue;
		inc(ans,mul(sum,dp[v]));
		inc(sum,dp[v]);
	}
	for(ri i=0; i<=mx; ++i)
	{
		inc(ans,mul(t.fi[i],kf[i]));
		inc(sum,mul(t.se[i],kf[i]));
	}
}
signed main()
{
#ifdef M207
	freopen("in.in","r",stdin);
	// freopen("ot.out","w",stdout);
#endif
	in(n,K);
	if(K==1)
	{
		int ans=(LL)n*(n-1)/2%md;
		out(ans);
		return 0;
	}
	for(ri i=1,a,b; i<n; ++i)
	{
		in(a,b);
		E[a].pb(b),E[b].pb(a);
	}
	fac[0]=1;
	for(ri i=1; i<=K; ++i) fac[i]=mul(fac[i-1],i);
	for(ri i=0; i<=K; ++i) kf[i]=mul(fac[K],mdinv(fac[K-i]));
	dfs(1,0);
	out(ans);
	return 0;
}
#pragma region
}
signed main()
{
	i207M::main();
	return 0;
}
#pragma endregion


#pragma region
#include <bits/stdc++.h>
using namespace std;
#define ri register int
#define il inline
#define LL long long
#define uint unsigned int
#define ull unsigned long long
#define solid const auto &
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define pll pair<LL,LL>
#define fi first
#define se second
#define gm int mid((l+r)/2)
#define space putchar(' ')
#define enter putchar('\n')
#define rd() ({ri t;in(t);t;})
#define Size(x) ((int)x.size())
#define mem(x,y) memset(x,y,sizeof(x))
template<class T>il void in(T &x)
{
	x=0; char c=getchar(); bool f=0;
	while(c<'0'||c>'9') f|=(c=='-'),c=getchar();
	while(c>='0'&&c<='9') x=x*10+(c^'0'),c=getchar();
	f?x=-x:0;
}
template<class T>il void out(T x,const char c='\n')
{
	static short st[30]; short m=0;
	if(x<0) {if(x==-2147483648) {printf("-2147483648"); return;} putchar('-'),x=-x;}
	do st[++m]=x%10,x/=10; while(x);
	while(m) putchar(st[m--]|'0');
	putchar(c);
}
template<class T,class ...Args>il void in(T &x,Args &...args) {in(x); in(args...);}
template<class T,class ...Args>il void out(const T &x,const Args &...args) {out(x,' '); out(args...);}
template<class T>il void prt(T a[],int n) {for(ri i=0; i<n; ++i) out(a[i],' '); enter;}
template<class T>il void clr(T a[],int n) {memset(a,0,sizeof(T)*n);}
template<class T>il void clr(T *a,T *b) {memset(a,0,sizeof(T)*(b-a));}
template<class T>il bool ckmax(T &a,const T &b) {return a<b?a=b,1:0;}
template<class T>il bool ckmin(T &a,const T &b) {return a>b?a=b,1:0;}
namespace MOD_CALC
{
const int md=998244353,inv2=(md+1)/2;
il int add(const int a,const int b) {return a+b>=md?a+b-md:a+b;}
il int sub(const int a,const int b) {return a-b<0?a-b+md:a-b;}
il int mul(const int a,const int b) {return (LL)a*b%md;}
il void inc(int &a,const int b) {(a+=b)>=md?a-=md:0;}
il void dec(int &a,const int b) {(a-=b)<0?a+=md:0;}
il int qpow(int a,int b) {int r=1; for(; b; b>>=1,a=mul(a,a)) if(b&1) r=mul(r,a); return r;}
il int mdinv(const int a) {return qpow(a,md-2);}
template<class ...Args>il int add(const int a,const int b,const Args &...args) {return add(add(a,b),args...);}
template<class ...Args>il int mul(const int a,const int b,const Args &...args) {return mul(mul(a,b),args...);}
} using namespace MOD_CALC;
namespace i207M
{
#pragma endregion
namespace Polynomial
{
const int Primitive_Root=3;
il int fit2(int x) {return 1<<(31-__builtin_clz(x)+(__builtin_popcount(x)!=1));}
struct Poly
{
	vector<int>f;
	Poly() {}
	explicit Poly(int siz) {resize(siz);}
	Poly(const vector<int> &tf):f(tf) {}
	Poly(const initializer_list<int> &tf):f(tf) {}
	Poly(const int n,const Poly &F) {resize(n); memcpy(&f[0],&F.f[0],sizeof(int)*n);}
	il int size() const {return Size(f);}
	il void clear() {f.clear();}
	il void resize(int siz) {f.resize(siz);}
	il int &operator[](const int x) {return f[x];}
	il const int &operator[](const int x) const {return f[x];}
	il int *begin() {return &f[0];}
	il int *end() {return &f.back()+1;}
	il void read(int n) {resize(n); for(ri i=0; i<n; ++i) in(f[i]);}
	il void print() const {for(ri i=0; i<Size(f); ++i) out(f[i],i==Size(f)-1?'\n':' ');}
	il void rev() {reverse(f.begin(),f.end());}
	il int value(int v) const {int r=0; for(ri i=Size(f)-1; i>=0; --i) r=add(mul(r,v),f[i]); return r;}
};
namespace Bitrev
{
vector<int>r;
void rev(int n,int f[])
{
	if(Size(r)!=n)
	{
		r.resize(n);
		for(ri i=0,hb=n>>1; i<n; ++i) r[i]=(r[i>>1]>>1)|((i&1)?hb:0);
	}
	for(ri i=0; i<n; ++i) if(i<r[i]) swap(f[i],f[r[i]]);
}
}
void dft(int n,int f[],int op)
{
	if(op==-1) reverse(f+1,f+n);
	Bitrev::rev(n,f);
	for(ri p=2; p<=n; p<<=1)
	{
		int len=p>>1,nx=qpow(Primitive_Root,(md-1)/p);
		for(ri k=0,w=1; k<n; k+=p,w=1)
			for(ri i=k; i<k+len; ++i)
			{
				int t=mul(w,f[i+len]);
				f[i+len]=sub(f[i],t),f[i]=add(f[i],t);
				w=mul(w,nx);
			}
	}
	if(op==-1)
	{
		int invn=mdinv(n);
		for(ri i=0; i<n; ++i) f[i]=mul(f[i],invn);
	}
}
il void dft(Poly &F,int op) {dft(F.size(),F.begin(),op);}
Poly Inv(int n,const Poly &A)
{
	if(n==1) return {mdinv(A[0])};
	int m=fit2(n<<1);
	Poly B(m),C=Inv((n+1)>>1,A); C.resize(m);
	for(ri i=0; i<n; ++i) B[i]=A[i];
	dft(B,1),dft(C,1);
	for(ri i=0; i<m; ++i) B[i]=C[i]*(2-(LL)B[i]*C[i]%md+md)%md;
	dft(B,-1); B.resize(n);
	return B;
}
il void operator+=(Poly &A,const Poly &B)
{
	if(Size(B)>Size(A)) A.resize(Size(B));
	for(ri i=0; i<Size(B); ++i) inc(A[i],B[i]);
}
il Poly operator+(Poly A,const Poly &B) {A+=B; return A;}
il void operator-=(Poly &A,const Poly &B)
{
	if(Size(B)>Size(A)) A.resize(Size(B));
	for(ri i=0; i<Size(B); ++i) dec(A[i],B[i]);
}
il Poly operator-(Poly A,const Poly &B) {A-=B; return A;}
il Poly operator-(Poly A) {for(ri i=0; i<Size(A); ++i) A[i]=md-A[i]; return A;}
il void operator*=(Poly &A,Poly B)
{
	int n=Size(A)+Size(B)-1,m=fit2(n);
	A.resize(m),B.resize(m); dft(A,1),dft(B,1);
	for(ri i=0; i<m; ++i) A[i]=mul(A[i],B[i]);
	dft(A,-1); A.resize(n);
}
il Poly operator*(Poly A,const Poly &B) {A*=B; return A;}
il void operator*=(Poly &A,const int v) {for(ri i=0; i<Size(A); ++i) A[i]=mul(A[i],v);}
il Poly operator*(Poly A,const int v) {A*=v; return A;}
il void Mul(Poly &A,const Poly &B) {int t=Size(A); A*=B; A.resize(t);}
il Poly Mul2(Poly A,const Poly &B) {Mul(A,B); return A;}
il Poly operator~(const Poly &F) {return Inv(Size(F),F);}
il Poly operator/(const Poly &A,const Poly &B)
{
	if(Size(A)<Size(B)) return {0};
	Poly F=A,G=B; F.rev(),G.rev();
	int t=Size(A)-Size(B)+1; G.resize(t);
	F*=~G; F.resize(t); F.rev(); return F;
}
il void operator/=(Poly &A,const Poly &B) {A=A/B;}
il Poly operator%(const Poly &A,const Poly &B)
{
	if(Size(A)<Size(B)) return A;
	Poly C=A-A/B*B; C.resize(Size(B)-1); return C;
}
il void operator%=(Poly &A,const Poly &B) {A=A%B;}
il Poly Qpow(Poly A,int b,const Poly &Md)
{
	Poly R= {1};
	for(; b; b>>=1,A=A*A%Md) if(b&1) R=R*A%Md;
	return R;
}
il void operator<<=(Poly &A,const int s)
{
	A.resize(Size(A)+s);
	for(ri i=Size(A)-1; i>=0; --i) A[i+s]=A[i];
	for(ri i=0; i<s; ++i) A[i]=0;
}
il Poly operator<<(Poly A,const int s) {A<<=s; return A;}
il void operator>>=(Poly &A,const int s) {for(ri i=s; i<Size(A); ++i) A[i-s]=A[i]; A.resize(Size(A)-s);}
il Poly operator>>(Poly A,const int s) {A>>=s; return A;}
Poly Sqrt(int n,const Poly &A) // assume that constant is 1
{
	if(n==1) return {1};
	Poly B(n,A),C=Sqrt((n+1)>>1,A); C.resize(n);
	Mul(B,~C);
	for(ri i=0; i<n; ++i) B[i]=mul(add(B[i],C[i]),inv2);
	return B;
}
il Poly Sqrt(const Poly &A) {return Sqrt(A.size(),A);}
il Poly delta(const Poly &A)
{
	Poly B(Size(A)-1);
	for(ri i=1; i<Size(A); ++i) B[i-1]=mul(A[i],i);
	return B;
}
il Poly inter(const Poly &A)
{
	static vector<int> iv= {0,1};
	Poly B(Size(A)+1);
	if(Size(iv)<Size(B))
	{
		int t=Size(iv); iv.resize(Size(B));
		for(ri i=t; i<Size(iv); ++i) iv[i]=mul(md-md/i,iv[md%i]);
	}
	for(ri i=1; i<Size(B); ++i) B[i]=mul(A[i-1],iv[i]);
	return B;
}
il Poly Ln(const Poly &A) // assume that constant is 1
{
	Poly B=delta(A)*~A; B.resize(Size(A)-1);
	return inter(B);
}
Poly Exp(int n,const Poly &A) // assume that constant is 0
{
	if(n==1) return {1};
	Poly B(n,A),C=Exp((n+1)>>1,A); C.resize(n);
	B-=Ln(C); ++B[0]; Mul(B,C);
	return B;
}
il Poly Exp(const Poly &A) {return Exp(Size(A),A);}
il Poly operator^(Poly A,const int K) // assume that constant is 1
{
	A=Ln(A); for(ri i=0; i<Size(A); ++i) A[i]=mul(A[i],K);
	return Exp(A);
}
} using namespace Polynomial;
#define N 100005
int n,K;
int fac[N],kf[N];
vector<int>E[N];
int sz[N];
int dp[N];
int A[N],B[N],C;
pair<Poly,Poly> build(int l,int r)
{
	if(l==r) return mp(Poly({B[l],mul(B[l],C)}), Poly({1,A[l]}));
	gm; auto ls=build(l,mid),rs=build(mid+1,r);
	return mp(ls.fi*rs.se+ls.se*rs.fi,ls.se*rs.se);
}
int ans;
void dfs(int x,int _fa)
{
	sz[x]=1;
	for(solid v:E[x])
	{
		if(v==_fa) continue;
		dfs(v,x); sz[x]+=sz[v];
	}
	if(sz[x]==1)
	{
		dp[x]=1;
		return;
	}
	int cnt=0;
	for(solid v:E[x])
	{
		if(v==_fa) continue;
		A[++cnt]=sz[v],B[cnt]=dp[v];
	}
	C=n-sz[x];
	auto t=build(1,cnt);
	int mx=min(Size(t.fi)-1,K);
	int &sum=dp[x];
	for(solid v:E[x])
	{
		if(v==_fa) continue;
		inc(ans,mul(sum,dp[v]));
		inc(sum,dp[v]);
	}
	for(ri i=0; i<=mx; ++i)
	{
		inc(ans,mul(t.fi[i],kf[i]));
		inc(sum,mul(t.se[i],kf[i]));
	}
}
signed main()
{
#ifdef M207
	freopen("in.in","r",stdin);
	// freopen("ot.out","w",stdout);
#endif
	in(n,K);
	if(K==1)
	{
		int ans=(LL)n*(n-1)/2%md;
		out(ans);
		return 0;
	}
	for(ri i=1,a,b; i<n; ++i)
	{
		in(a,b);
		E[a].pb(b),E[b].pb(a);
	}
	fac[0]=1;
	for(ri i=1; i<=K; ++i) fac[i]=mul(fac[i-1],i);
	for(ri i=0; i<=K; ++i) kf[i]=mul(fac[K],mdinv(fac[K-i]));
	dfs(1,0);
	out(ans);
	return 0;
}
#pragma region
}
signed main()
{
	i207M::main();
	return 0;
}
#pragma endregion