What is the measure of angle X?

====================================================
Explanation:
Focus on triangle BDH
Interior angles B and D are given to be 40 and 31 respectively. Interior angle H is unknown
For any triangle, the interior angles always add to 180
B+D+H = 180
40+31+H = 180
H+71 = 180
H = 180-71
H = 109
Interior angle H is 109 degrees for triangle BDH
The exterior angle is 180 minus this measure
exterior angle = 180 - (interior angle)
exterior angle = 180 - 109
exterior angle = 71
Note how this is the sum of interior angles B and D, so you could use the remote interior angle theorem here.