-- your code goes here a = {{1,2,3,4,}, {5,6,7,8,}, {9,10,11,12}, {13,14,15,16}} bottom = {} top = {} for i, v in ipairs(a) do for j, w in ipairs(v) do if(i > j) then table.insert(bottom, w) else if(i < j) then table.insert(top, w) end end end end print("Top:") for i=1, #top do print(top[i]) end print("Bottom:") for i = 1, #bottom do print(bottom[i]) end