Convert height to US Men’s Jacket size In the US, clothing size sometimes has rough designations like M, L, XXL, etc. The US designation of the &quot;men's jacket&quot; category depends on the height of the person. So, in this challenge, you should implement this conversion, which is defined by the following table, taken from this site:

US size Body height (cm)
XXXS    160 - 164
XXS     162 - 166
XS      166 - 170
S       168 - 173
M       171 - 176
L       174 - 182
XL      180 - 186
XXL     184 - 189
3XL     187 - 193
4XL     191 - 194
5XL     193 - 198
6XL     197 - 200

* I chose the &quot;men's jacket&quot; category from there because it has the most variability
Input
Body height, in cm. As a number or a string.
Output
Size designation - as a return value or printed.
Additional rules

For some sizes, designation is uncertain (e.g. 174, 175 and 176 correspond to both M and L) - your converter should return one of these, deterministically or not
If it's easier, output fully spelled versions like XXXXL instead of 4XL; however, 2XL and 2XS are invalid (apparently they are used in real life, but I decided to forbid them because I thought they weren't)
Assume the input is valid, i.e. a whole number between 160 and 200
Python 2, 58 55 52 49 47 45 bytes
-13 bytes with great contributions from Arnauld (thanks!!!), xnor and xash.
Switched from Python 3 to Python 2 for an extra 2 bytes.
Tried to profit from the overlapping regions. You don't even need a size M, because the sizes of S and L don't have a gap between them. Luckily, the number of X's for S and L can be expressed as a linear integer expression.

lambda h:max(173-h&gt;&gt;2,h/3-60)*'X'+'SL'[h&gt;173]

Try it online!
Just for fun (and for educational purposes) the original 58 bytes submission:

lambda h:(-h+173)//4*'X'+'S'if h&lt;174else(h-180)//3*'X'+'L'