fn main() { let mut hw = String::new(); std::io::stdin().read_line(&mut hw).ok(); let hw: Vec = hw.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let h = hw[0]; let w = hw[1]; let mut ss: Vec<(i64, i64)> = vec![]; for i in 0..h { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let s = s.trim().chars().enumerate() .filter(|c| c.1 == '*'); for c in s { ss.push((i as i64, c.0 as i64)); } } let point: (i64, i64) = if ss[0].0 == ss[1].0 { ((ss[0].0 + 1) % h, ss[0].1) } else if ss[0].1 == ss[1].1 { (ss[0].0, (ss[0].1 + 1) % w) } else { (ss[0].0, ss[1].1) }; ss.push(point); for i in 0..h { for j in 0..w { print!("{}", if ss.contains(&(i, j)) { '*' } else { '-' }); } println!(); } }