using System.Collections.Generic;
public static void Main(string[] args)
string command, scode, sarg;
Queue <int> myQueue = new Queue<int>();
command = Console.ReadLine();
if (command == "") break;
scode = command.Substring(0, 1);
case 1: sarg = command.Substring(2);
case 2: if (myQueue.Count!=0)
Console.WriteLine(myQueue.Dequeue());
else Console.WriteLine(-1); break;
case 3: if (myQueue.Count!=0)
Console.WriteLine(myQueue.Peek());
else Console.WriteLine(-1); break;
case 4: if (myQueue.Count!=0)
{ Console.Write(myQueue.Dequeue() + ""); }
else Console.WriteLine(-1); break;