In a certain sequence of 80 numbers, any term, except for the two endpoints, is equal to the product of its neighboring terms. The product of the first 40 terms of the sequence is 8 and the product of all the terms is also 8. Determine the terms of the sequence.