Write a program to find the consecutive same word in a sentence


#1

like if input is

car hello cycle cycle yes no
answer: cycle

car cycle motor cycle

answer:nothing


#3

s=input()
k=list(s.split(" "))
f=1
for i in range(len(k)-1):
 if(k[i]==k[i+1]):
  print(k[i])
  f=0
if f :
 print(“nothing”)