Spontaneous graphitization of ultrathin cubic structures: a computational study.