The reactivity of graphite surfaces with atoms and molecules of hydrogen, oxygen and nitrogen