EDIT There was an essential step left out in the proof. Thanks to Al Jebr for pointing it out.
Since I've muddled the matter with my comments, I'll post an answer, although you only asked for a hint. I'll try to phrase it as a sequence of hints, so you can stop reading when you want.
First, this seems to have something to do with Taylor polynomials. After all, they allow us to find a polynomial that satisfies the criteria for one of these tuples.
In particular, there is a polynomial $$p_1(x)= \sum_{k=0}^n{\frac{a_k}{k!}(x-x_1)^k}$$ that satisfies the criteria for the first tuple, and furthermore every polynomial $q$ that satisfies these criteria is of the form $q(x)=p_1(x)+(x-x_1)^{n+1}p_2(x)$ for some polynomial $p_2$.
Now the $a_k$ don't tell us any more. Any polynomial will work for $p_2,$ so we ask how the second tuple can help us find the coefficients of $p_2.$
By now, it's easy to guess that Taylor's theorem should help here, too. For convenience in what follows, I'll write $F(x) = (x-x_1)^{n+1}.$ so that our formula becomes $q(x)=p_1(x)+F(x)p_2(x).$
Since all we know about is what happens at $x_2,$ it's plain that we must evaluate $q$ at $x_2$. Notice that $F^{(k)}(x_2) \ne 0$ for $0\le k \le n,$ since we are given $x_1 \ne x_2.$
EDIT This is where I left out a step. I said that we have to use Taylor's theorem a second time, but then I didn't do it!
Now we look at the Taylor polynomial of $p_2$ at $x_2.$
$$p_2(x)= \sum_{k=0}^n{\frac{c_k}{k!}(x-x_2)^k,}$$ for some constants $c_k$.
By Leibniz's formula for the derivative of a product,$$q^{(i)}(x_2) = p_1^{(i)}(x_2) + \sum_{j=0}^i{\binom{i}{j}F^{(i-j)}(x_2)}p_2^{(j)}(x_2)\text{ for } i=0,...,n. $$
Since none of the derivatives of $F$ vanish, and all the terms involving $c_k$ vanish, except the term involving $c_i,$ we can compute the coeffcients of $p_2$ one by one. Again, by Taylor's theorem, $p_2$ is unique up to term of degree higher than $n.$