A strategy to rapidly determine the magnitude of great earthquakes