Let's start with the algorithm