#c22402. Palisection
Palisection
Palisection
Problem Source
CF 17E
Problem Description
You are given a string consisting of lowercase letters. Find the number of pairs of palindromic substrings that share at least one common character, and output the answer modulo .
Input Format
The first line contains an integer , the length of the string.
The second line contains a string .
Output Format
Output one integer: the answer modulo .
Sample Input
4
babb
Sample Output
6
Constraints
For all data, , and the string consists of lowercase letters only.