6. Let's call the distance between numbers the absolute value of their difference. It is known that the sum of the distances from eleven consecutive natural numbers to some number $a$ is 902, and the sum of the distances from these same eleven numbers to some number $b$ is 374. Find all possible values of $a$, given that $a+b=98$.
Answer: $a=107, a=-9, a=25$.

Solution. Let the given sequence of natural numbers be denoted as $k, k+1, \ldots, k+10$. Notice that if some number lies on the interval $[k ; k+10]$, then the sum of the distances from it to these eleven numbers does not exceed $\frac{11}{2} \cdot 10=55$ (the sum of the distances to the two extreme numbers is exactly 10, the sum of the distances to $k+1$ and $k+9$ does not exceed 10, the sum of the distances to $k+2$ and $k+8$ also does not exceed 6, and so on; the distance to $k+5$ does not exceed half the length of the interval between the extreme numbers, i.e., 5). Therefore, the numbers $a$ and $b$ lie outside the interval $[k ; k+10]$. Then the sum of the distances from the number $a$ to each of the given consecutive numbers is expressed by the formula $|11 a-k-(k+1)-\ldots-(k+10)|=11|a-k-5|$. Similarly, the sum of the distances from the number $b$ to each of the given numbers is $11|b-k-5|$. We obtain the system of equations

$$
\left\{\begin{array} { l } 
{ 1 1 | a - k - 5 | = 9 0 2 , } \\
{ 1 1 | b - k - 5 | = 3 7 4 , } \\
{ a + b = 9 8 }
\end{array} \Leftrightarrow \left\{\begin{array}{l}
|a-k-5|=82 \\
|b-k-5|=34 \\
a+b=98
\end{array}\right.\right.
$$

Consider four cases for the removal of the modulus.

1) Both numbers $a$ and $b$ lie to the right of the interval $[k ; k+10]$. Then

$$
\left\{\begin{array} { l } 
{ a - k - 5 = 8 2 , } \\
{ b - k - 5 = 3 4 , } \\
{ a + b = 9 8 }
\end{array} \Leftrightarrow \left\{\begin{array}{l}
a=73 \\
b=25 \\
k=-14
\end{array}\right.\right.
$$

Since $k$ must be a natural number, this case does not fit.

2) Both numbers $a$ and $b$ lie to the left of the interval $[k ; k+10]$. Then

$$
\left\{\begin{array} { l } 
{ - a + k + 5 = 8 2 , } \\
{ - b + k + 5 = 3 4 , } \\
{ a + b = 9 8 }
\end{array} \Leftrightarrow \left\{\begin{array}{l}
a=25 \\
b=73 \\
k=102
\end{array}\right.\right.
$$

3) The number $a$ lies to the right, and $b$ to the left of the interval $[k ; k+10]$. Then

$$
\left\{\begin{array} { l } 
{ a - k - 5 = 8 2 , } \\
{ - b + k + 5 = 3 4 , } \\
{ a + b = 9 8 }
\end{array} \Leftrightarrow \left\{\begin{array}{l}
a=107 \\
b=-9 \\
k=20
\end{array}\right.\right.
$$

4) The number $b$ lies to the right, and $a$ to the left of the interval $[k ; k+10]$. Then

$$
\left\{\begin{array} { l } 
{ - a + k + 5 = 8 2 , } \\
{ b - k - 5 = 3 4 , } \\
{ a + b = 9 8 }
\end{array} \Leftrightarrow \left\{\begin{array}{l}
a=-9 \\
b=107 \\
k=68
\end{array}\right.\right.
$$

Thus, there are three possible cases: $a=25, a=107, a=-9$.