Inserting new line if two sequential lines begin with the same string

Hi

I have a file like this:

Peter North
Mary
Peter North
Peter Borough
Mary

I need there to put 'X' (or anything) on a new line between the two lines where 'Peter' begins the line. There will be many matches to this string, but they will always begin with 'Peter'.

Ie, the resulting output should be something like this:

Peter
Mary
Peter
X
Peter
Mary

Trying to work this out is proving difficult so if anyone has any suggestions...?

Like so? (two consecutive lines start with the same word):

awk '$1==p{print "x"}{p=$1}1' file

or only for "peter" ?

awk '$1==p && p==s{print "x"}{p=$1}1' s=Peter file

Just the first field:

awk '$1==p{print "x"}{print p=$1}1' file

or

awk '$1==p && p==s{print "x"}{print p=$1}' s=Peter file

brilliant. thankyou so much!