ap or gp when input is both

what happens when input sequence is both ap and gp.