Problem: Iahubina is tired of so many complicated languages, so she decided to invent a new, simple language. She already made a dictionary consisting of n 3-words. A 3-word is a sequence of exactly 3 lowercase letters of the first 24 letters of the English alphabet (a to x). She decided that some of the letters are vowels, and all the others are consonants. The whole language is based on a simple rule: any word that contains at least one vowel is correct.

Iahubina forgot which letters are the vowels, and wants to find some possible correct sets of vowels. She asks Iahub questions. In each question, she will give Iahub a set of letters considered vowels (in this question). For each question she wants to know how many words of the dictionary are correct, considering the given set of vowels.

Iahubina wants to know the xor of the squared answers to all the possible questions. There are 224 different questions, they are all subsets of the set of the first 24 letters of the English alphabet. Help Iahub find that number.

Input

The first line contains one integer, n (1 ≤ n ≤ 104). Each of the next n lines contains a 3-word consisting of 3 lowercase letters. There will be no two identical 3-words.

Output

Print one number, the xor of the squared answers to the queries.

Examples

Input

5
abc
aaa
ada
bcd
def


Output

0

Solution (in JAVA):

Solution:
import java.util.*;
import java.math.*;
import java.lang.*;
import java.io.*;

public class vowels
{
    static int n,k;
    static int[] arr;
    public static void main(String[] args) {
        InputReader in      = new InputReader(System.in);
        OutputWriter out    =   new OutputWriter(System.out);
        int n = in.readInt();
        String[] str = new String[n];
        for(int i=0;i<n;i++)
            str[i] = in.readString();
        int[] arr = new int[n];
        for(int i=0;i<n;i++)
        {
            arr[i] = 1<<((int)str[i].charAt(0) - (int)'a' +0) | 1<<((int)str[i].charAt(1) - (int)'a' +0) | 1<<((int)str[i].charAt(2) - (int)'a' +0);
            //System.out.println(arr[i]);
        }
        int[] freq = new int[(1<<24)+2];
        int[] dp = new int[(1<<24)+2];
        for(int i=0;i<n;i++)
            freq[arr[i]]++;
        for(int i=0;i<(1<<24);i++)
            dp[i] = freq[i];

        for(int i=0;i<24;i++)
            for(int mask=0;mask<(1<<24);mask++)
                if((mask&(1<<i))!=0)
                    dp[mask] += dp[mask^(1<<i)];
        long ans = 0L;
        for(int i=0;i<(1<<24);i++)
            ans ^= (n-dp[i])*(n-dp[i]);
        
        out.printLine(ans);

        out.flush();
        out.close();
    }

    long power(int x, int y, int p)
    {
    long res = 1;      
 
    x = x % p;  
 
    while (y > 0)
    {
       
        //if (y & 1)
            res = (res*x) % p;
 
        y = y>>1; 
        x = (x*x) % p;  
    }
    return res;
    }

    static boolean check(int c)
    {
        int count=1;
        int last=arr[0];
        for(int i=1;i<n;i++)
        {
            if(arr[i]-last >= c)
            {
                count++;
                if(count==k)
                    return true;
                last = arr[i];
            }
        }
        return false;
    }

    static int bs()
    {
        int low=0,high=arr[n-1];
        int max = Integer.MIN_VALUE;
        while(low<high)
        {
            int mid = low + (high-low)>>1;
            if(check(mid))
            {
                low = mid+1;
                max = Math.max(max,mid);
            }
            else
                high = mid-1;
        }
        return max;
    }
     
}


class InputReader {
 
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private final StringBuilder sb = new StringBuilder();
 
        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int[] nextInts(int n, int start) {
            int[] res = new int[n];
            for (int i = start; i < n; i++) {
                res[i] = readInt();
            }
            return res;
        }

        public String nextLine() {
            int c = read();
            if (c == -1) {
                return null;
            }

            sb.setLength(0);

            do {
                sb.append((char) c);
                c = read();
            } while (c != -1 && c != '\n');

            return sb.toString();
        }
 
        public int read() {
            if (numChars == -1)
                throw new NumberFormatException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new NumberFormatException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
 
        public int readInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new NumberFormatException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }
 
        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
        public String next() {
            return readString();
        }
 
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
 
class OutputWriter {
        private final PrintWriter writer;
 
        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }
 
        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }
 
        public void print(Object...objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0)
                    writer.print(' ');
                writer.print(objects[i]);
            }
        }
 
        public void printLine(Object...objects) {
            print(objects);
            writer.println();
        }
 
        public void close() {
            writer.close();
        }
 
        public void flush() {
            writer.flush();
        }
 
        }
 
class IOUtils {
 
        public static int[] readIntArray(InputReader in, int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++)
                array[i] = in.readInt();
            return array;
        }
 
        }