Ex-headmaster at Army and Navy academy sentenced in molestation case