Periods of homeomorphisms on closed surfaces