Some Changes added third solution