local function E(s)local c=type(s)assert(c=="\116\097\098\108\101","\101\120\112\101\099\116\101\100 \097 \116\097\098\108\101 \102\111\114 \102\105\114\115\116 \097\114\103\117\109\101\110\116\044 \103\111\116 "..c)local H={}local l=1 for c=1,#s,1 do if type(s[c])=="\116\097\098\108\101"then local K=E(s[c])for E=1,#K,1 do H[l]=K[E]l=l+1 end else H[l]=s[c]l=l+1 end end return H end return E

local function flatten(list)
	local listType = type(list)
	assert(listType == "table", "expected a table for first argument, got " .. listType)
	
	local new = {}
	local index = 1

	for i = 1, #list do
		if type(list[i]) == "table" then
			local layer = flatten(list[i])

			for j = 1, #layer do
				new[index] = layer[j]
				index = index + 1
			end
		else
			new[index] = list[i]
			index = index + 1
		end
	end

	return new
end

return flatten