Let $\{X_i;\, i\geq 1\},\,\{Y_i;\,i\geq 1\},\,\{U, U_i;\, i\geq 1\}$ and $\{V, V_i;\, i\geq 1\}$ be four i.i.d. sequences of random variables. Suppose U and V are uniformly distributed on $[0,1]^3.$ For each realization of $\{U_j;\, 1\leq j\leq n\},\ \{X_{i,p};\break \, 1\leq p \leq n\}$ is constructed as a certain permutation of $\{X_p;\, 1\leq p\leq n\}$ for any $1\leq i \leq n.$ Also, $\{Y_{j,p};\, 1\leq p \leq n\}, 1\leq j\leq n,$ are constructed the same way, based on $\{Y_j\}$ and $\{V_j\}.$ For a score function F, we show that \begin{eqnarray*} W_n:= \max_{1\leq i, j,m \leq n}\sum_{p=1}^m F(X_{i,p},Y_{j, p}) \end{eqnarray*} has an asymptotic extreme distribution with the same parameters as in the one-dimensional case. This model is constructed for a comparison of scores of protein structures with foldings.