lexicographical ordering in mode A1, increasing order in mode A2