Greece beat Hungary to advance to water polo final