a+b+c+d+e = x
x-a=798
+
x-b=794
x-c=813
x-d=806
x-e=789
5*x - (a+b+c+d+e)=4000
5*x - x = 4*x=4000
x=1000
a+b+c+d+e = x
x-a=798
+
x-b=794
+
x-c=813
+
x-d=806
+
x-e=789
5*x - (a+b+c+d+e)=4000
5*x - x = 4*x=4000
x=1000