using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static string InputPattern = "InputX";
static List<string> GetInputList()
{
var WillReturn = new List<string>();
if (InputPattern == "Input1") {
WillReturn.Add("4 4 4 1 3 2");
WillReturn.Add("1 2");
WillReturn.Add("2 3");
WillReturn.Add("3 4");
WillReturn.Add("1 4");
//4
}
else if (InputPattern == "Input2") {
WillReturn.Add("6 5 10 1 2 3");
WillReturn.Add("2 3");
WillReturn.Add("2 4");
WillReturn.Add("4 6");
WillReturn.Add("3 6");
WillReturn.Add("1 5");
//0
}
else if (InputPattern == "Input3") {
WillReturn.Add("10 15 20 4 4 6");
WillReturn.Add("2 6");
WillReturn.Add("2 7");
WillReturn.Add("5 7");
WillReturn.Add("4 5");
WillReturn.Add("2 4");
WillReturn.Add("3 7");
WillReturn.Add("1 7");
WillReturn.Add("1 4");
WillReturn.Add("2 9");
WillReturn.Add("5 10");
WillReturn.Add("1 3");
WillReturn.Add("7 8");
WillReturn.Add("7 9");
WillReturn.Add("1 6");
WillReturn.Add("1 2");
//952504739
}
else {
string wkStr;
while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
}
return WillReturn;
}
// 隣接リスト
static Dictionary<int, List<int>> mToNodeListDict = new Dictionary<int, List<int>>();
const int Hou = 998244353;
static void Main()
{
List<string> InputList = GetInputList();
int[] wkArr = { };
Action<string> SplitAct = pStr =>
wkArr = pStr.Split(' ').Select(pX => int.Parse(pX)).ToArray();
SplitAct(InputList[0]);
int N = wkArr[0];
int UB = N;
int K = wkArr[2];
int S = wkArr[3];
int T = wkArr[4];
int X = wkArr[5];
foreach (string EachStr in InputList.Skip(1)) {
SplitAct(EachStr);
int FromNode = wkArr[0];
int ToNode = wkArr[1];
if (mToNodeListDict.ContainsKey(FromNode) == false) {
mToNodeListDict[FromNode] = new List<int>();
}
if (mToNodeListDict.ContainsKey(ToNode) == false) {
mToNodeListDict[ToNode] = new List<int>();
}
mToNodeListDict[FromNode].Add(ToNode);
mToNodeListDict[ToNode].Add(FromNode);
}
// 場合の数[現在ノード , Xの訪問数のmod2] な DP表
int[,] PrevDP = new int[UB + 1, 2];
PrevDP[S, 0] = 1;
for (int LoopI = 1; LoopI <= K; LoopI++) {
int[,] CurrDP = new int[UB + 1, 2];
for (int LoopJ = 0; LoopJ <= UB; LoopJ++) {
for (int LoopK = 0; LoopK <= 1; LoopK++) {
if (PrevDP[LoopJ, LoopK] == 0) continue;
if (mToNodeListDict.ContainsKey(LoopJ) == false) {
continue;
}
foreach (int EachToNode in mToNodeListDict[LoopJ]) {
int NextJ = EachToNode;
int NextK = LoopK;
if (NextJ == X) {
NextK = (NextK + 1) % 2;
}
CurrDP[NextJ, NextK] += PrevDP[LoopJ, LoopK];
CurrDP[NextJ, NextK] %= Hou;
}
}
}
PrevDP = CurrDP;
}
Console.WriteLine(PrevDP[T, 0]);
}
}