#![allow(non_snake_case, unused_imports)] use std::collections::{BinaryHeap, HashMap, HashSet}; use ac_library::{Additive, Min, Segtree}; use proconio::{input, marker::Usize1, marker::Chars}; use itertools::Itertools; #[allow(unused_macros)] macro_rules! d { ( $( $x:expr ),* $(,)? ) => { eprintln!( concat!( $( stringify!($x), "={:?} " ),* ), $( $x ),* ); }; } #[allow(dead_code)] fn yn(b: bool) -> &'static str { if b { "Yes" } else { "No" } } fn main() { input! { T: [i64; 7], } let ans = T.iter() .scan(6000, |s, &t| { let ns = if *s == -1 || t == -1 { -1 } else { (*s - t).max(-1) }; *s = ns; Some(ns) }) .collect_vec(); println!("{}", ans.iter().join("\n")); }