import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd import pypyjit pypyjit.set_param('max_unroll_recursion=-1') n,m,k = map(int,input().split()) graph = [[] for i in range(n+1)] for i in range(m): u,v = map(int,input().split()) graph[u-1].append(v-1) graph[v-1].append(u-1) mod = 998244353 mem = dict() def f(cnt, last): if max(cnt) == min(cnt) == k: return 1 if tuple(cnt + [last]) in mem.keys(): return mem[tuple(cnt + [last])] res = 0 for nxt in graph[last]: if cnt[nxt] == k: continue new = cnt[::1] new[nxt] += 1 res += f(new, nxt) res %= mod mem[tuple(cnt + [last])] = res return res ans = 0 for i in range(n): cnt = [0]*n cnt[i] += 1 ans += f(cnt, i) ans %= mod print(ans)