Travel

아직 제출이 없습니다시간 제한2.5초메모리 제한256 MB

문제

"I'm tired of seeing the same scenery in the world." --- Philosopher Pang

Pang's world can be simplified as a directed graph GG with nn vertices and mm edges.

A path in GG is an ordered list of vertices (v_0,,v_t1)(v\_0,\ldots,v\_{t-1}) for some non-negative integer tt such that v_iv_i+1v\_iv\_{i+1} is an edge in GG for all 0i\<t10\le i\<t-1. A path can be empty in this problem.

A cycle in GG is an ordered list of distinct vertices (v_0,,v_t1)(v\_0,\ldots,v\_{t-1}) for some positive integer t2t \geq 2 such that v_iv_(i+1)modtv\_iv\_{(i+1) \bmod t} is an edge in GG for all 0i\<t0\le i\<t. All circular shifts of a cycle are considered the same.

GG satisfies the following property: Every vertex is in at most one cycle.

Given a fixed integer kk, count the number of pairs (P_1,P_2)(P\_1,P\_2) modulo 998244353998244353 such that 

  1. P_1,P_2P\_1,P\_2 are paths;
  2. For every vertex vGv\in G, vv is in P_1P\_1 or P_2P\_2;
  3. Let c(P,v)c(P, v) be the number of occurrences of vv in path PP. For every vertex vv of GG, c(P_1,v)+c(P_2,v)kc(P\_1,v)+c(P\_2, v)\le k.

입력

The first line contains 33 integers nn, mm and kk (1n2000,0m4000,0k10000000001\le n\le 2000, 0\le m\le 4000, 0\le k\le 1000000000).

Each of the next mm lines contains two integers aa and bb, denoting an edge from vertex aa to bb (1a,bn,ab1\le a, b\le n, a\neq b). 

No two edges connect the same pair of vertices in the same direction.

출력

Output one integer --- the number of pairs (P_1,P_2)(P\_1,P\_2) modulo 998244353998244353.