  The simplest non-trivial solutions of WDVV equations are A_n and
B_n-potentials, which describe metrics of K.Saito on spaces of versal
deformation of A_n and B_n-singularities. These are some polynomials, which
were known for $n\leqslant$ 4. We find some recurrence relations, which give a
possibility to find all A_n and B_n-potentials. In passing we give recurrence
formulas for coefficients of dispersionless KP hierarchy.
