Correct option is B
According to question ,
Let's solve this step by step:
Step 1: Understand the Information Given
Seven people: A, B, C, D, E, F, and G are sitting in a straight line, facing north.
Only three people sit to the left of D.
Only two people sit between D and A.
B sits fifth to the right of C.
G sits to the immediate right of E but somewhere to the left of A.
Step 2: Analyze the Information
Three people sit to the left of D:
This means D is in the 4th position from the left:
_,_,_,D,_,_,_
Only two people sit between D and A:
If A is in the 1st position:
A,_,_, D,_,_,_ OR _,_,_,D,_,_,A
B sits fifth to the right of C:
For B to be fifth to the right of C,_,_, D,_,B, A or A C _ D _ _ B
G sits to the immediate right of E but somewhere to the left of A
Therefore, the lineup is: C, E, G, D,_, B, A
F: The only remaining person is F, who must be in the 5th position: C, E, G, D, F, B, A
Alternative method:

So, A sits to the extreme right.