AMC8 1989 Problem 22

The letters A,J,H,S,M,E and the digits $1,9,8,9 $are “cycled” separately as follows and put in a numbered list:

1. JHSMEA 9891.

2. HSMEAJ 8919.

3. SMEAJH 9198.

What is the number of the line on which AJHSME 1989 will appear for the first time?

Answer Choices
A. 6
B. 10
C. 12
D. 18
E. 24