Implement the page replacement algorithm for FIFO, OPTIMAL, 2nd chance