#C6128. Palindrome Rearrangement

    ID: 49854 Type: Default 1000ms 256MiB

Palindrome Rearrangement

Palindrome Rearrangement

Problem Statement:

You are given a string s. Your task is to determine whether the characters of s can be rearranged to form a palindrome. A palindrome is a string that reads the same forwards and backwards. For a string to be rearranged into a palindrome, there can be at most one character that appears an odd number of times. In mathematical terms, if we let ( n ) be the number of characters with an odd frequency, then the necessary and sufficient condition is ( n \leq 1 ).

For example, the string "civic" is already a palindrome, while the string "ivicc" can be rearranged to form "civic". However, the string "hello" cannot be rearranged into any palindrome.

inputFormat

Input is provided via standard input (stdin). The input consists of a single line containing the string s, which may include any printable ASCII characters. The length of s is between 0 and 105 inclusive.

outputFormat

Output a single line to standard output (stdout):

- Print POSSIBLE if the characters of s can be rearranged to form a palindrome.
- Otherwise, print IMPOSSIBLE.## sample

civic
POSSIBLE