Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
$X$ is not path-connected, and any path-connected component is a increasing union of grids in finite dimension, $\pi_1(X)$ is just going to be a free group of countably infinite rank (as for the grid in $\mathbb R^2$).
You should put a restriction on the rank, as shown by the example of Dave Rusin. Even with that, I don’t believe there is a classification, the size of the largest finite $2$-generated group of exponent $n$ probably grows much faster than exponential in $n$ (see « restricted Burnside problem »).
I guess you should have a look at « Knapsack problem in groups » (where we usually take $x_i$ non-negative integers). It has been studied in nilpotent groups, see arxiv.org/abs/1507.05145 and arxiv.org/abs/1606.08584 , but I don’t think the specific result you’re asking for was written down beforehand.