Cavity Method for the Sherrington-Kirkpatrick Model