(REG) Recognized gain for section 351

Hello all, In section 351 where the shareholders recognize the 'GAIN' when they receive boot or have net liabilty excess of basis. Would like to ask if this is a capital gain or and ordinary gain. The book never clarifies it. Also, where would this figure be inserted in form 1040? Your knowledge will be greatly appreciated. Thank you!