Solve this special combinatorics and algebra problem for me please Two days ago, my math team teacher post this problem but I have no idea to solve it and I don't know the answer.

For all distinct positive integer here $a$, $b$, $c$, $d$, $e$, $f$,
  $g$, $h$ is equal or less than 8, how many ways does it satisfy all
  those conditions,
$a-b=5$
$c-d=2$
$e-f=2$
$g-h=3$

How to generalize a method to solve those type of problem?
 A: You have eight distinct positive integers from 1 to 8. Now considering the first equation:
$a-b=5$ : There are three possibilities for this to happen,
$(a,b)$ : $(6,1)$, $(7,2)$ or $(8,3)$


*

*Suppose $a=6$ and $b=1$, so considering other equations we should
have $(4,2)$ and $(5,3)$, then there's no valid answer for the last
equation $g-h=3$.

*Suppose $a=8$ and $b=3$, for the second and third we can have $(4,2)$ and $(7,5)$, again the last one has no valid answer.


So the answer could be:
$a=7$, $b=2$, $c=3$, $d=1$, $e=6$, $f=4$, $g=8$ and $h=5$
or
$a=7$, $b=2$, $c=6$, $d=4$, $e=3$, $f=1$, $g=8$ and $h=5$
or
$a=7$, $b=2$, $c=8$, $d=6$, $e=5$, $f=3$, $g=4$ and $h=1$.

I solved the whole problem once again and found another answer. To make sure that I didn't make a mistake this time, I checked it using Mathemtica:

{{$a -> 7, b -> 2, c -> 3, d -> 1, e -> 6, f -> 4, g -> 8, h -> 5$},
  {$a -> 7, b -> 2, c -> 5, d -> 3, e -> 8, f -> 6, g -> 4, h -> 1$},
  {$a -> 7, b -> 2, c -> 6, d -> 4, e -> 3, f -> 1, g -> 8, h -> 5$},
  {$a -> 7, b -> 2, c -> 8, d -> 6, e -> 5, f -> 3, g -> 4, h -> 1$}}

That proves that I missed another possibility. To make it short, I wouldn't solve such problems by hand (as I did), the probability of missing something important is quite high.
A: Draw the following figure:
$$\circ\quad\circ\quad\bullet\quad\circ\quad\circ\ \ |\ \circ\quad\circ\quad\bullet\quad\circ\quad\circ\qquad.$$
Here the bullets $\bullet$ represent $a$ and $b$. Draw near the upper rim of a second piece of paper the following figure:
$$\bigcirc\quad\circ\quad\circ\quad\bigcirc\qquad,$$
where now the big circles $\bigcirc$  represent $g$ and $h$. By moving the second figure horizontally under and along the first you can immediately see that only the choice
$$\circ\quad\bigcirc\quad\bullet\quad\circ\quad\bigcirc\ \ |\ \circ\quad\circ\quad\bullet\quad\circ\quad\circ$$ and its reflection with respect to $|$ allow an admissible selection of the remaining four numbers $c$, $d$, $e$, $f$ – the word "allow" meaning that in the end we have $8$ consecutive numbers selected.
