A is 18th from front and C is 25th. Number of persons between A and C = 6. Since C is exactly in middle of A and B, so number of persons between C and B = 6.
7
↔
A
6
↔
C
6
↔
B
15
↔
∴ Number of persons in the queue = (17 + 1 + 6 + 1 + 6 + 1 + 15) = 47