Simple Queue#202

Simple Queue

1 second
64 megabytes
Very easy (≈850)

queue Implement the given data structure. Write a program that provides a description of the queue and models its operation by implementing all the specified methods. The program reads sequential commands and performs operations based on the command. After executing each command, the program should output one line. The possible commands for the program are:

push n

Add the number n to the queue (the value of n is given after the command). The program should output ok.

pop

Remove the first element from the queue. The program should output its value.

front

The program should output the first element without removing it from the queue.

size

The program should output the number of elements in the queue.

clear

The program should clear the queue and output ok.

exit

The program should output bye and terminate.

The sequence of input commands is guaranteed to meet the following requirements: the maximum number of elements in the queue at any time does not exceed 100, all pop and front commands are valid, meaning that during their execution, there is always at least one element in the queue.

Input

Explained in the statement. Also see the sample of input.

Output

Given in the statement. Also see the sample of output.

Examples

Example 1

Loading
Loading