Artificial intelligent assistant

Given a string of adjacent sides of a die, determine the opposite side of each side A total of $N-1$ actions are performed on a 6-sided die, each one representing a 90-degree rotation of the die whose axis is unknown. Each time, the number on the topside of the die is written down, hence there's a string of N numbers (the first number being the one before the first action taking place). Now my problem is, given one such string of N numbers where each consecutive two represent the numbers produced on the topside of the die by a 90-degree rotation, is there a way to determine the opposite side of each number, or proving that there does not exist such a solution?

A simple way to do this is to fill out the adjacency matrix of the die, which is a (symmetric) matrix that has a $1$ in its $ij$th entry if side $i$ and $j$ are adjacent to each other on the die (i.e. you can get from $i$ to $j$ by doing a single 90 degree rotation), and a $0$ otherwise (put $0$s on the diagonal as well).

**Here's how to do it:** For each pair of consecutive numbers $\\{i,j\\}$ in your list, put a $1$ in the $ij$th entry of adjecency matrix. If you find that some row has more than four $1$s in it, the die is inconsistent (side $i$ should have a $0$ exactly for the connection with itself and side opposite to it) and you can stop. Otherwise keep going until either the adjacency matrix is filled (and every row has two $0$s and four $1$s) or your list ends (it could be that the list doesn't contain enough information to construct the layout of the die).

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 54ef2e57c96d4a4035cfc27748797013