using System.Collections;
using System.Collections.Generic;
using System.Data.DataSetExtensions;
using System.Text.RegularExpressions;
using System.Xml.Serialization;
using System.Globalization;
using System.Diagnostics;
public static void Main()
var names = new [] { "John", "Alex", "Peter", "Eric" };
var letters = new [] { "A", "B", "C", "D" };
var results = letters.SelectMany(x => names, (x, y) => new {x, y, idx = index++})
.GroupBy(x=>x.idx/names.Length)
.Select(x=> x.ToDictionary(s=>s.y, s=> s.x))
foreach(var result in results)