i am getting option A and C are correct.
in C option after f we will back to f->g->d and then d->b->a
therefore option C is right and remaining options B and D are incorrect because c can not occur just after d and d can not occur just after c respectively.