class Town: def __init__(self, init: int): self.current = 0 self.before = init self.neighbors = [] def connect(self, other): self.neighbors.append(other) def next_career(self): self.current = sum(neighbor.before for neighbor in self.neighbors) def daily(self): self.before = self.current self.current = 0 class Network: def __init__(self, num: int): self.towns = [Town(0) for _ in range(num)] self.towns[0].before = 1 self.day = 0 def update(self): for town in self.towns: town.next_career() for town in self.towns: town.daily() self.day += 1 def connect(self, num1: int, num2: int): self.towns[num1].connect(self.towns[num2]) self.towns[num2].connect(self.towns[num1]) def main(): N, M, T = map(int, input().split()) network = Network(N) for _ in range(M): s, t = map(int, input().split()) network.connect(s, t) while network.day < T: network.update() print(network.towns[0].before % 998244353) if __name__ == "__main__": main()