const C4: f64 = 261.6; const D4: f64 = 294.3; const E4: f64 = 327.0; const F4: f64 = 348.8; const G4: f64 = 392.4; const A4: f64 = 436.0; const B4: f64 = 490.5; fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut a = String::new(); std::io::stdin().read_line(&mut a).ok(); let a: Vec = a.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let mut sounds = vec![0isize; 7]; let hz = vec![C4, D4, E4, F4, G4, A4, B4]; let words = vec!["C4", "D4", "E4", "F4", "G4", "A4", "B4"]; for i in 0..n { for j in 0..hz.len() { let val = hz[j] / n as f64 * i as f64; if val > 1. && val < 261. { sounds[j] += (a[i] - a[((val - val.floor()) * n as f64 / hz[j]).floor() as usize]).abs(); } } } eprintln!("{:?}", sounds); let idx = sounds.iter().enumerate().min_by_key(|(_, &v)| v).unwrap().0; println!("{}", words[idx]); }