Upon notice and hearing, as provided in section 123A.46 for the attachment of dissolved districts, all territory of school districts dissolved by sections 123A.64 to 123A.72 and all area of the state not in a district maintaining classified elementary and secondary schools must be attached by order of the county board to organized districts maintaining classified elementary and secondary schools, grades 1 through 12, unless a district has made an agreement with another district or districts as provided in section 123A.30 or 123A.32.