  Gale and Ryser found a criterion for existence of a binary matrix with given
row and column sums. Mirsky extended the theorem of Gale and Ryser to $q$-ary
matrices. In this paper, we are interested in higher dimensional extension of
these theorems. We first introduce multidimensional matrices as a higher
dimensional generalization of matrices. We next replace the concept of row and
columns in matrices by lines in multidimensional matrices. We finally find a
criterion for existence of a $q$-ary multidimensional matrices with given line
sums.
