Module Stable {
      Inventory queue alfa 
      Stack New {
            Data "UK", "London","US", "New York","US", "Birmingham", "UK","Birmingham"
            While not empty {
                  Append alfa, Letter$:=letter$
            }
      }
      sort alfa
      k=Each(alfa)
      Document A$
      NL$={
      }
      While k {
            A$= Eval$(k, k^)+" "+eval$(k)+NL$
      }
      Clipboard A$ ' write to clipboard
      Report A$
}
Call Stable

Output:
UK London
UK Birmingham
US New York
US Birmingham