  Our first-principles calculations demonstrate that ${\rm C}_{60-n}{\rm
B}_{n}$ and ${\rm C}_{60-m}{\rm N}_{m}$ molecules can be engineered as the
acceptors and donors, respectively, which are needed for molecular electronics,
by properly controlling the number $n$ and $m$ of the substitutional dopants in
${\rm C}_{60}$. As an example, we show that acceptor ${\rm C}_{48}{\rm B}_{12}$
and donor ${\rm C}_{48}{\rm N}_{12}$ are promising components for molecular
rectifiers, carbon nanotube-based $p$-type, $n$-type, $n$-$p$-$n$ and
$p$-$n$-$p$ transistors and $p$-$n$ junctions.
