Starting address given to Company $= 18.104.22.168$
No. of Subnets needed $= 1000$
ie; no. of bits needed from host address part $= \left \lceil \log _2 1000 \right \rceil = 10$
The $1000$ subnets will be numbered from $0$ to $999$.
So the starting address of the $last$ subnet $= 999$,
which is $11\space 1110\space 0111$. Putting this in subnet part, the starting address of the last subnet is,
for $DBA$(Direct broadcast address), put $all\space host\space bits$ $1$.
So, $DBA$ of the $last$ subnet is,
$181.55.1111\space10 01. 1111\space 1111$
The starting address of the $second\space last$ subnet $(0-999)$ will be $998$, or $11\space 1110\space 0110$. Putting this in place of subnet address, we get the starting address of the $second\space last$ subnet as,
Since $All \space1$s being broadcast address, $11\space 1111$ can't be a host address, hence the $last$ host address will be $11\space 1110$.
Therefore the $last\space host$ in the above subnet is,
which is $22.214.171.124$.
So, the $fourth\space last\space host$ will have an address