Let
a,
b,
f and
s be the ages of
A,
B,
F and
S respectively.
A is elder to B by 2 years. So, a=b+2. ⟹a−b=2
F is twice as old as A. So, f=2a.
B is twice as old as S. So, b=2s.
Finally, the ages of F and S differ by 40 years. So, f−s=40.
Substituting f=2a and s=b2 into f−s=40, we get 2a−b2=40.
⟹4a−b=80.
Subtracting the equation a−b=2 from 4a−b=80, we get
3a=78.
⟹a=26
So, the age of A is 26 years.