The number in each block is the magnitude of the difference of the two numbers below it.
P = |17 -11| = 6 . . . . . selection B
Working from the bottom up, the empty boxes below Q are 16 -12 = 4, 10 -4 = 6. Then ...
Q = 7 -6 = 1 . . . . . selection A