using System.Collections.Generic;
public static void Main()
Action<List<string>, List<string>> e = (c,n)=>{foreach(var i in n){var j=c.IndexOf(i);if(j!=0){c[j]=c[j-1];c[j-1]=i;}}};
var spiceRack = new List<string> { "pepper", "paprika", "salt", "cumin", "oregano" };
var input = new List<string> { "salt", "salt", "salt", "salt", "salt", "salt", "salt", "salt", "salt", "salt", "salt", "salt", "oregano" };
foreach (var spice in spiceRack)
Console.WriteLine(spice);