The result compared with a deficit of $23.6 billion for the same period a year earlier