Technicolor interview question

Write a program to enter these no in queue and print them