Non Palindromic Words: A string with one or more words is passed as the input. The program must print only the words which are not palindromes. Print -1 if all the words in the string are palindromes.
1 <= N, Length of S <= 1000
The first line contains S.
The first line contains the words which are not palindromes separated by a space.
Example Input/Output 1:
Today madam came to the class
Today came to the class
Example Input/Output 2:
s=input().split() k=0 for i in s: if i!=i[::-1]: k=1 print(i,end=' ') if k==0:print(-1)