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 lines = (0..m).map(|_| { 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(); (temp[0], temp[1]) }) .collect::>(); let mut dp = vec![vec![0usize; n]; t+1]; dp[0][0] = 1; for i in 0..t { for &(s, t) in lines.iter() { dp[i+1][s] += dp[i][t]; dp[i+1][t] += dp[i][s]; dp[i+1][s] %= MOD; dp[i+1][t] %= MOD; } } println!("{}", dp[t][0]); }