To solve this problem, we need to determine the value of x, which represents the number of candies Alicia needs to buy in order to have a multiple of 8.
We know that Alicia's current number of candies, n, is a positive integer with three digits and the smallest possible value is 123.
If Alicia buys x more candies, her total number of candies will be n + x.
We are given two conditions:
1. If Alicia buys X more candies, her total number of candies will be a multiple of 8.
2. If Alicia loses 8 candies, her total number of candies will be a multiple of 5.
Let's set up the equations based on these conditions:
1. (n + x) % 8 = 0
2. (n - 8) % 5 = 0
Now, let's substitute the smallest possible value of n, which is 123, into these equations:
1. (123 + x) % 8 = 0
2. (123 - 8) % 5 = 0
Simplifying the equations:
1. (123 + x) % 8 = 0
2. 115 % 5 = 0
We can solve the second equation:
115 % 5 = 0
115 is not divisible by 5, so this equation is not possible.
Therefore, the value of x is not determined by the given conditions.
The value of x cannot be determined.
The answer is: 5
Below is a math problem. Provide a detailed, step-by-step solution.

### Problem:
Alicia has $n$ candies, where $n$ is a positive integer with three digits. If she buys X more, she will have a multiple of $8$. If she loses $8$, she will have a multiple of $5$. The smallest possible value of $n$ is 123. What is the value of unknown variable X?

### Answer:
