Everything you've done with the numbers is correct. The part you're misunderstanding is what a cheque actually is.
Think of a cheque like an IOU (before it is cashed). By the end of the day, F is on -4 mil ie it has given 4 million in IOUs more than it has received, meaning it owes 4 mil. On the other hand, N is on +4 mil ie it has received 4 million in IOUs more than it has given, meaning it is owed 4 mil. Therefore, this could be settled by F paying N 4 mil.
Hope that helps!