DIV = 998244353 # N : 都市の個数 # M : 道路の本数 # T : 目標の日数 N, M, T = map(lambda x: int(x), input().split()) T += 1 # 各都市同士のつながりをあらわす辞書 road = {} for i in range(M): s, t = map(lambda x: int(x), input().split()) if s in road: road[s].append(t) else: road[s] = [t] if t in road: road[t].append(s) else: road[t] = [s] # 状態遷移テーブル table = [[0] * N for i in range(T)] # 都市0のT=0時点での初期値を設定 table[0][0] = 1 for t in range(1, T): for n in range(N): if table[t-1][n] == 0: continue if n not in road: continue for city in road[n]: table[t][city] += table[t-1][n] # 結果表示 print(table[-1][0] % DIV)