Quantum three-body system in D dimensions