uses System.Generics.Collections;
var
IntQueue: TQueue<Integer>;
Top, First, Second, Third: Integer;
begin
IntQueue := TQueue<Integer>.Create;
IntQueue.Enqueue(1);
IntQueue.Enqueue(3);
IntQueue.Enqueue(5);
Top := IntQueue.Peek;
//top is 1
First := IntQueue.Dequeue;
//first is 1
Second := IntQueue.Dequeue;
//second is 3
Third := IntQueue.Dequeue;
//third is 5
WriteLn('top is ', Top);
WriteLn('first is ', First);
WriteLn('second is ', Second);
WriteLn('third is ', Third);
end.