LANGEVIN DYNAMICS OF HEAVY FLAVORS IN RELATIVISTIC HEAVY-ION COLLISIONS