use std::collections::VecDeque; fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut c = String::new(); std::io::stdin().read_line(&mut c).ok(); let mut c: Vec = c.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let summary = c.iter().sum::(); c.sort(); if summary < 0 { c.reverse(); } let a = c.iter().skip(n/2+n%2).sum::(); let b = c.iter().take(n/2+n%2).sum::(); println!("{}", a.abs() - b.abs()); }