Code for Queue, hot potato game and printing tasks