Petya has a string of length n consisting of small and large English letters and digits.

He performs m operations. Each operation is described with two integers l and r and a character c: Petya removes from the string all characters c on positions between l and r, inclusive. It's obvious that the length of the string remains the same or decreases after each operation.

Find how the string will look like after Petya performs all m operations.

Input

The first string contains two integers n and m (1 ≤ n, m ≤ 2·105) — the length of the string and the number of operations.

The second line contains the string of length n, consisting of small and large English letters and digits. Positions in the string are enumerated from 1.

Each of the next m lines contains two integers l and r (1 ≤ l ≤ r), followed by a character c, which is a small or large English letter or a digit. This line describes one operation. It is guaranteed that r doesn't exceed the length of the string s before current operation.

Output

Print the string Petya will obtain after performing all m operations. If the strings becomes empty after all operations, print an empty line.

Examples

Input

4 2
abac
1 3 a
2 2 c


Output

b


Input

3 2
A0z
1 3 0
1 1 z


Output

Az


Input

10 4
agtFrgF4aF
2 5 g
4 9 F
1 5 4
1 7 a


Output

tFrg4


Input

9 5
aAAaBBccD
1 4 a
5 6 c
2 3 B
4 4 D
2 3 A


Output

AB

Note

In the first example during the first operation both letters 'a' are removed, so the string becomes "bc". During the second operation the letter 'c' (on the second position) is removed, and the string becomes "b".

In the second example during the first operation Petya removes '0' from the second position. After that the string becomes "Az". During the second operations the string doesn't change.
import java.util.*;
import java.io.*;

public class Problem
{
    static int mod = (int) (1e9);
    static InputReader in;
    static PrintWriter out;
    
    static void update(int i, int val, int[] bit){
        for(i++ ; i < bit.length; i += (i&-i))
            bit[i] += val;
    }
    
    static int query(int i, int[] bit){
        int ans=0;
        
        for(i++ ; i>0; i -= (i&-i))
            ans += bit[i];
        
        return ans;
    }
    
    static int get(int l, int r, int[] bit){
        if(l > r) return 0;
        return query(r, bit) - query(l - 1, bit);
    }
    
    public static void main(String[] args)
    {
        in = new InputReader(System.in);
        out = new PrintWriter(System.out);            
        
        int n = in.nextInt();
        int m = in.nextInt();
        String s = in.readString();
        int[] bit = new int[n + 10];
        TreeSet<Integer>[] set = new TreeSet[62];
        
        for(int i = 0; i < 62; i++){
            set[i] = new TreeSet<Integer>();
        }
        for(int i = 0; i < n; i++){
            int c = s.charAt(i);
            if(c >= 'A' && c <= 'Z')
                set[c - 'A'].add(i + 1);
            else if(c >= 'a' && c <= 'z')
                set[c - 'a' + 26].add(i + 1);
            else
                set[c - '0' + 52].add(i + 1);
            update(i + 1, 1, bit);
        }
        
        while(m-- > 0){
            int a = in.nextInt();
            int b = in.nextInt();
            char c = in.readString().charAt(0);
            int l = 1;
            int r = n;
            int x = 0;
            while(r - l >= 0){
                int mid = (r + l) >> 1;
                if(query(mid, bit) < a){
                    x = mid;
                    l = mid + 1;
                }
                else r = mid - 1;
            }
            l = 1;
            r = n;
            int y = 0;
            while(r - l >= 0){
                int mid = (r + l) >> 1;
                if(query(mid, bit) <= b){
                    y = mid;
                    l = mid + 1;
                }
                else r = mid - 1;
            }
            int z = 0;
            if(c >= 'A' && c <= 'Z') z = c - 'A';
            else if(c >= 'a' && c <= 'z') z = c - 'a' + 26;
            else z = c - '0' + 52;

            while(set[z].higher(x) != null){
                x = set[z].higher(x);
                if(x > y) break;
                set[z].remove(x);
                update(x, -1, bit);
            }
        }
        char[] str = new char[n];
        Arrays.fill(str, '-');

        for(int i = 0; i < 62; i++){
            for(int j : set[i]){
                if(i < 26) str[j - 1] = (char)(i + 'A');
                else if(i < 52) str[j - 1] = (char)(i + 'a' - 26);
                else str[j - 1] = (char)(i + '0' - 52);
            }
        }
        for(int i = 0; i < n; i++)
            if(str[i] != '-')
                out.print(str[i]);

        out.println();
        out.close();
        
    }

    static class Pair implements Comparable<Pair>
    {

        int x,y;
        int i;
        long c;

        Pair (int x, long c)
        {
                this.x = x;
                this.c = c;
        }

        Pair (int x,int y)
        {
                this.x = x;
                this.y = y;
        }

        Pair (int x, int y, int i)
        {
                this.x = x;
                this.y = y;
                this.i = i;
        }

        public int compareTo(Pair o)
        {
            return Long.compare(this.x,o.x);
                //return 0;
        }

        public boolean equals(Object o)
        {
            if (o instanceof Pair)
            {
                Pair p = (Pair)o;
                return p.x == x && p.y==y;
            }
            return false;
        }

        @Override
        public String toString()
        {
            return x + " "+ y + " "+c;
        }

        /*public int hashCode()
        {
            return new Long(x).hashCode() * 31 + new Long(y).hashCode();
        }*/

    } 

    static long add(long a,long b){
        long x=(a+b);
//        while(x >= mod) x-=mod;
        return x % mod;
    }

    static long sub(long a,long b){
        long x=(a-b + mod);
//        while(x<0) x+=mod;
        return x % mod;
    }
    
    static long mul(long a,long b){
        long x=( a * b );
        return x % mod;
    }
    
    static String rev(String s){
        StringBuilder sb=new StringBuilder(s);
        sb.reverse();
        return sb.toString();
    }
    
    static long gcd(long x,long y)
    {
        if(y==0)
                return x;
        else
                return gcd(y,x%y);
    }

    static int gcd(int x,int y)
    {
        if(y==0)
                return x;
        else 
                return gcd(y,x%y);
    }

    static long pow(long n,long p,long m)
    {
         long  result = 1;
          if(p==0){
            return 1;
          }
          
        while(p!=0)
        {
            if(p%2==1)
                result *= n;
            if(result >= m)
               result %= m;
            p >>=1;
            n*=n;
            if(n >= m)
                n%=m;
        }
        
        return result;
    }

    static long pow(long n,long p)
    {
        long  result = 1;
          if(p==0)
            return 1;

        while(p!=0)
        {
            if(p%2==1)
                result *= n;	    
            p >>=1;
            n*=n;	    
        }
        return result;
    }

    static void debug(Object... o)
    {
            System.out.println(Arrays.deepToString(o));
    }

    static class InputReader
    {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream)
        {
                this.stream = stream;
        }

        public int snext()
        {
                if (snumChars == -1)
                        throw new InputMismatchException();
                if (curChar >= snumChars)
                {
                        curChar = 0;
                        try
                        {
                                snumChars = stream.read(buf);
                        } catch (IOException e)
                        {
                                throw new InputMismatchException();
                        }
                        if (snumChars <= 0)
                                return -1;
                }
                return buf[curChar++];
        }

        public int nextInt()
        {
                int c = snext();
                while (isSpaceChar(c))
                {
                        c = snext();
                }
                int sgn = 1;
                if (c == '-')
                {
                        sgn = -1;
                        c = snext();
                }
                int res = 0;
                do
                {
                        if (c < '0' || c > '9')
                                throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = snext();
                } while (!isSpaceChar(c));
                return res * sgn;
        }

        public long nextLong()
        {
                int c = snext();
                while (isSpaceChar(c))
                {
                        c = snext();
                }
                int sgn = 1;
                if (c == '-')
                {
                        sgn = -1;
                        c = snext();
                }
                long res = 0;
                do
                {
                        if (c < '0' || c > '9')
                                throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = snext();
                } while (!isSpaceChar(c));
                return res * sgn;
        }

        public int[] nextIntArray(int n)
        {
                int a[] = new int[n];
                for (int i = 0; i < n; i++)
                {
                        a[i] = nextInt();
                }
                return a;
        }

        public long[] nextLongArray(int n)
        {
                long a[] = new long[n];
                for (int i = 0; i < n; i++)
                {
                        a[i] = nextLong();
                }
                return a;
        }

        public String readString()
        {
                int c = snext();
                while (isSpaceChar(c))
                {
                        c = snext();
                }
                StringBuilder res = new StringBuilder();
                do
                {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isSpaceChar(c));
                return res.toString();
        }

        public String nextLine()
        {
                int c = snext();
                while (isSpaceChar(c))
                        c = snext();
                StringBuilder res = new StringBuilder();
                do
                {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isEndOfLine(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;
        }

        private boolean isEndOfLine(int c)
        {
                return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter
        {
                public boolean isSpaceChar(int ch);
        }

    }
}    
