So, I believe x would have to be 23 at least for three reasons.
1. The side of a triangle can’t be a negative or a zero
2. 23-22, is 1(one side), x=23 (another side), 23+6, 29 (last side)
That is more than 31,
3. Anything less wouldn’t work because you have to have a number than is the same or bigger than x
So x = 23