Castro resigns as president