6. Let $a$, $b$, $c$, $a+b-c$, $a+c-b$, $b+c-a$, $a+b+c$ be 7 distinct prime numbers, and among $a$, $b$, $c$, the sum of two of them is 800. Let $d$ be the difference between the largest and smallest of these 7 prime numbers. Find the maximum possible value of $d$.
(2001, China Mathematical Olympiad)
(Tip: Comparison method. Answer: 1 594.)