<p>You are given two integers <code>m</code> and <code>n</code>, which represent the dimensions of a matrix.</p>
<p>You are also given the <code>head</code> of a linked list of integers.</p>
<p>Generate an <code>m x n</code> matrix that contains the integers in the linked list presented in <strong>spiral</strong> order <strong>(clockwise)</strong>, starting from the <strong>top-left</strong> of the matrix. If there are remaining empty spaces, fill them with <code>-1</code>.</p>