Some schools build affordable housing to retain teachers