const MOD: usize = 998244353; fn main() { let mut nmt = String::new(); std::io::stdin().read_line(&mut nmt).ok(); let nmt: Vec = nmt.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let n = nmt[0]; let m = nmt[1]; let t = nmt[2]; let mut lines = Vec::with_capacity(m); for _ in 0..m { let mut temp = String::new(); std::io::stdin().read_line(&mut temp).ok(); let temp: Vec = temp.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let u = temp[0]; let v = temp[1]; lines.push((u, v)); } let mut dp = vec![vec![0usize; n]; t+1]; dp[0][0] = 1; for i in 0..t { for &(u, v) in lines.iter() { dp[i+1][v] += dp[i][u]; dp[i+1][u] += dp[i][v]; dp[i+1][v] %= MOD; dp[i+1][u] %= MOD; } } println!("{}", dp[t][0]); }