Finding a specific funcion with parameters given, tough seeming question

Heres the question, I have tried to construct such a function, but I keep having trouble making it so both conditions are met, I seem to only be able to manufacture a function that works for one of the conditions, or the other, but not both simultaneous. I dont need a full blown answer, but I would definantly like some guidence as to where to go next:

If $\displaystyle x_1, ... , x_n $are distinct numbers, find a polynomial function $\displaystyle f_i$ of degree $\displaystyle n-1$ which is $\displaystyle 1$ at $\displaystyle x_i$ and $\displaystyle 0$ at $\displaystyle x_j$ for $\displaystyle j \neq i$.

The question also gives a hint:

The product of all $\displaystyle (x-x_j)$ for $\displaystyle j \neq i$, is $\displaystyle 0$ at $\displaystyle x_j$ if $\displaystyle j \neq i$.

Thank you for any help on this question that anybody can give.