Strong quake hits near Acapulco, buildings sway in capital