package main import ( "fmt" "math" ) func main() { var aw, ab, bw, bb, c, d float64 _, _ = fmt.Scan(&aw, &ab, &bw, &bb, &c, &d) // fmt.Println(aw, ab, bw, bb) ab, bb = ab-c, bb+math.Min(ab, c) if ab < 0 { aw, ab, bw = aw+ab, 0, bw-ab } // fmt.Println(aw, ab, bw, bb) bw, aw = bw-d, aw+math.Min(bw, d) if bw < 0 { bw, bb, ab = 0, bb+bw, ab-bw } fmt.Println(aw, ab, bw, bb) }