Anti-Palindrome

시간 제한1초메모리 제한1024 MB

요약
글자가 아닌 문자는 무시하고 대소문자를 구분하지 않으며, 길이 2 이상인 회문이 나타나는지 판정한다.
난이도

쉬움10점 중 3점

유형
문자열, 구현
정답자
아직 제출이 없습니다

문제

A palindrome is a sequence of two or more characters that reads the same both forward and backward. Palindromes can appear inside a longer text, such as “Happy days are here again.” in which “pp”, “ehe” and “ere” are some of the palindromes (ignoring spaces, punctuation, and case). An anti-palindrome is a sequence of two or more characters in which there are no palindromes. You are given text that may contain, or itself form, a palindrome. Your task is to determine if there are any palindromes in the text, in which case declare "Palindrome", or if there are none, declare "Anti-palindrome". The text may contain spaces, as well as alphabetic and other non-alphabetic characters. All non-alphabetic characters should be ignored, and uppercase and lowercase letters are considered the same when detecting palindromes.

입력

The input consists of one line of text as specified above. The input line will not be longer than 80 characters, and contains at least one alphabetic character.

출력

Print "Palindrome" if the text contains or is itself a palindrome, or "Anti-palindrome" if there are no palindromes in the text.

예제3

  1. 예제 1

    입력
    Happy days are here again.
    
    예상 출력
    Palindrome
    
  2. 예제 2

    입력
    It is game day.
    
    예상 출력
    Palindrome
    
  3. 예제 3

    입력
    It was game day.
    
    예상 출력
    Anti-palindrome