using System.Text.RegularExpressions;
using System.Collections.Generic;
public static void Main()
string text = Console.ReadLine();
string partPattern = @"([^&=?]*)=\s*([^&=]*)";
while(!text.Equals("END"))
string replacement = @"(%20|\+)+";
text = Regex.Replace(text, replacement, " ");
Regex regex = new Regex(partPattern);
MatchCollection matches = regex.Matches(text);
Dictionary<string, List<string>> values = new Dictionary<string, List<string>>();
foreach(Match match in matches)
string valuesKey = match.Groups[1].ToString().Trim();
string valuesValue = match.Groups[2].ToString().Trim();
if(!values.ContainsKey(valuesKey))
values.Add(valuesKey, new List<string>());
values[valuesKey].Add(valuesValue);
foreach(var val in values)
Console.Write("{0}=[{1}]",val.Key, string.Join(", ", val.Value));
text = Console.ReadLine();