using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _4.List_Operations { class Program { static void Main(string[] args) { List numbers = Console.ReadLine().Split(' ').Select(int.Parse).ToList(); while (true) { string cmmnd = Console.ReadLine(); if (cmmnd=="End") { break; } string[] command=cmmnd.Split(); if (command[0]=="Add") { numbers.Add(int.Parse(command[1])); } else if (command[0]=="Insert") { if (int.Parse(command[1])<0||int.Parse(command[1])>=numbers.Count) { Console.WriteLine("Invalid index"); } else { numbers.Insert(int.Parse(command[2]),int.Parse(command[1])); } } else if (command[0]=="Remove") { if (int.Parse(command[1])<0||int.Parse(command[1])>=numbers.Count) { Console.WriteLine("Invalid index"); } else { numbers.RemoveAt(int.Parse(command[1])); } } else if(command[0]=="Shift"&&command[1]=="right") { for (int i=0;i