St. Patrick 's Cathedral , a standing-room-only crowd that included the United Nations secretary general , Kofi Annan , and former Mayor Rudolph W. Giuliani heard Cardinal Edward M. Egan celebrate a Mass in memory of a pope whose final days of suffering , he said , were a lesson in humility . ''