Official Explanation
The passage indicates that Miguel’s password is nine characters long, contains at least one character of each of five different types—digits, punctuation marks, uppercase letters, lowercase letters, and "other characters"—and either begins or ends with one of the "other characters." We are also given the first three characters the password: M, ?, and G. So, because the password begins with an uppercase letter, it must end with one of the "other characters." We know the password contains more lowercase letters than characters of any of the other types, so it must contain at least three lowercase letters. We also know that there is at least one punctuation mark and fewer punctuation marks than digits, lowercase letters, or uppercase letters, so there must be at least two digits.
Given that the password is nine characters long, one can now determine the distribution of all the characters in the password across all five of the types: one other character, one punctuation mark, two digits, two uppercase letters, and three lowercase letters. We know that the two uppercase letters and the one punctuation mark are among the first three characters and that the "other character" is the ninth character of the password. Therefore, characters 4 through 8 of the password consist of two digits and three lowercase letters. The passage indicates that no consecutive characters are of the same type, and this entails that characters 4, 6, and 8 are all lowercase letters, otherwise two or more lowercase letters would appear consecutively. If characters 4, 6, and 8 are all lowercase letters, then both character 5 and character 7 must be digits.
The correct answer is Digit for both.