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.io.*;
import java.util.*;
import java.util.function.IntConsumer;

public class Solution {


    static MyScanner sc;
    private static PrintWriter out;
    static long M2 = 1_000_000_000L + 7;

    private static HashMap<Long, Long>[] mods;

    public static void main(String[] s) throws Exception {
        StringBuilder stringBuilder = new StringBuilder();
//        stringBuilder.append("500 24 ");
//        stringBuilder.append("LLLLcyLLLcLccccccyyycyLyycycycyLyccyLccyLyyyLLyLLcyyLLLcyyyLycycccLLyLLycLyyLyccccLyLLcycLcLcyLcLcyLyccccLyyccLcLyccycyLccyyyyycyLccyyyLLyLLccyLLcycyLycccLLcyyLLLcyLycccLyyLyyLyyyLcLyycyLLccLyLyyyyyycLcycycLyLcLycyLyLyLLyyLLycyyccyycyyLcLyycyLcLLLLycLyyyLyLcycyLyLLyccLccyyyLyccLyLycLLycLyLLcLLccyccycLLyLyccyLyyycyLycLcLLccyycccccLyyccyyLcycLccyLLcLLcyLLLcycLLLLLLyLLcyLcLLycyccycLLLycccccLcLccLyyLLLyLLyLyccLcLcLLyyyccLyyyLcccccyLLLccyLycLcycccyLLLcycLcyycLLLccLLyLLyLcccLyLLcLLcycycLLycccLyLcyLycy");
//        Random r = new Random();
//        for (int i = 0; i < 24; i++) {
//            int l = r.nextInt(400) + 1;
//            stringBuilder.append(" " + l + " " + (l + r.nextInt(40) + 1) + " L ");
//        }
        if (stringBuilder.length() == 0) {
            sc = new MyScanner(System.in);
        } else {
            sc = new MyScanner(new BufferedReader(new StringReader(stringBuilder.toString())));
        }

        out = new PrintWriter(new OutputStreamWriter(System.out));

        initData();
        solve();
        out.flush();
    }

    static boolean[] k = new boolean[101];

    private static void initData() {

    }

    static int[] res;

    private static void solve() throws IOException {
        int n = sc.nextInt();
        int k = sc.nextInt();
        String l = sc.next();

        HashMap<Character, TrMap> pos = new HashMap<>();
        for (int i = 0; i < n; i++) {
            pos.computeIfAbsent(l.charAt(i), e -> new TrMap()).put(i, i);
        }

        TrMap trMap1 = new TrMap();
        for (int i = 0; i < n; i++) {
            trMap1.put(i, i);
        }

        boolean[] out1 = new boolean[n];
        while (k-- > 0) {
            int l0 = sc.nextInt();
            int l1 = sc.nextInt();
            char r = sc.next().charAt(0);

            TrMap mp = pos.get(r);
            if (mp == null) continue;

            int ps0 = trMap1.v(l0 - 1);
            int ps1 = trMap1.v(l1 - 1);
            mp.remove(ps0, ps1, k2 -> {
                trMap1.remove(k2);
                out1[k2] = true;
            });
        }
        for (int i = 0; i < n; i++) {
            if (!out1[i]) {
                out.print(l.charAt(i));
            }
        }
    }

    private static final class TrMap {
        TEntry root = null;
        int size = 0;

        public long put(int key, long value) {
            TEntry t = root;
            if (t == null) {
                root = new TEntry(key, value, null);
                size = 1;
                return -2;
            }
            int cmp;
            TEntry parent;
            do {
                parent = t;
                cmp = Integer.compare(key, t.key);
                if (cmp < 0)
                    t = t.left;
                else if (cmp > 0)
                    t = t.right;
                else
                    return t.setValue(value);
            } while (t != null);
            TEntry e = new TEntry(key, value, parent);
            TEntry k = parent;
            while (k != null) {
                k.size++;
                k = k.parent;
            }
            if (cmp < 0)
                parent.left = e;
            else
                parent.right = e;
            fixAfterInsertion(e);
            size++;
            return -4;
        }

        public long remove(int key) {
            TEntry p = getEntry(key);
            if (p == null)
                return -2;

            long oldValue = p.value;
            deleteEntry(p);
            return oldValue;
        }

        public void remove(int from, int to, IntConsumer ll) {
            while (true) {
                TEntry cur = root;
                while (cur != null) {
                    int v = cur.key;
                    if (v >= from && v <= to) {
                        ll.accept(v);
                        deleteEntry(cur);
                        break;
                    }
                    if (cur.key < to) {
                        cur = cur.right;
                    } else {
                        cur = cur.left;
                    }
                }
                if (cur == null) return;
            }
        }

        final TEntry getEntry(int key) {

            TEntry p = root;
            while (p != null) {
                int cmp = Integer.compare(key, p.key);
                if (cmp < 0)
                    p = p.left;
                else if (cmp > 0)
                    p = p.right;
                else
                    return p;
            }
            return null;
        }


        private static boolean colorOf(TEntry p) {
            return (p == null ? BLACK : p.color);
        }

        private static TEntry parentOf(TEntry p) {
            return (p == null ? null : p.parent);
        }

        private static void setColor(TEntry p, boolean c) {
            if (p != null)
                p.color = c;
        }

        private static TEntry leftOf(TEntry p) {
            return (p == null) ? null : p.left;
        }

        private static TEntry rightOf(TEntry p) {
            return (p == null) ? null : p.right;
        }

        private void rotateLeft(TEntry p) {
            if (p != null) {
                TEntry r = p.right;

                int rs = p.size;
                p.size = p.size - size(p.right) + size(r.left);
                r.size = rs;


                p.right = r.left;
                if (r.left != null)
                    r.left.parent = p;
                r.parent = p.parent;
                if (p.parent == null)
                    root = r;
                else if (p.parent.left == p)
                    p.parent.left = r;
                else
                    p.parent.right = r;
                r.left = p;
                p.parent = r;
            }
        }

        private void rotateRight(TEntry p) {
            if (p != null) {
                TEntry l = p.left;

                int rs = p.size;
                p.size = p.size - size(p.left) + size(l.right);
                l.size = rs;


                p.left = l.right;
                if (l.right != null) l.right.parent = p;
                l.parent = p.parent;
                if (p.parent == null)
                    root = l;
                else if (p.parent.right == p)
                    p.parent.right = l;
                else p.parent.left = l;
                l.right = p;
                p.parent = l;
            }
        }

        private void fixAfterInsertion(TEntry x) {
            x.color = RED;

            while (x != null && x != root && x.parent.color == RED) {
                if (parentOf(x) == leftOf(parentOf(parentOf(x)))) {
                    TEntry y = rightOf(parentOf(parentOf(x)));
                    if (colorOf(y) == RED) {
                        setColor(parentOf(x), BLACK);
                        setColor(y, BLACK);
                        setColor(parentOf(parentOf(x)), RED);
                        x = parentOf(parentOf(x));
                    } else {
                        if (x == rightOf(parentOf(x))) {
                            x = parentOf(x);
                            rotateLeft(x);
                        }
                        setColor(parentOf(x), BLACK);
                        setColor(parentOf(parentOf(x)), RED);
                        rotateRight(parentOf(parentOf(x)));
                    }
                } else {
                    TEntry y = leftOf(parentOf(parentOf(x)));
                    if (colorOf(y) == RED) {
                        setColor(parentOf(x), BLACK);
                        setColor(y, BLACK);
                        setColor(parentOf(parentOf(x)), RED);
                        x = parentOf(parentOf(x));
                    } else {
                        if (x == leftOf(parentOf(x))) {
                            x = parentOf(x);
                            rotateRight(x);
                        }
                        setColor(parentOf(x), BLACK);
                        setColor(parentOf(parentOf(x)), RED);
                        rotateLeft(parentOf(parentOf(x)));
                    }
                }
            }
            root.color = BLACK;
        }

        /**
         * Delete node p, and then rebalance the tree.
         */
        private void deleteEntry(TEntry p) {
            size--;

            if (p.left != null && p.right != null) {
                TEntry s = successor(p);
                p.key = s.key;
                p.value = s.value;
                p = s;
            }
            TEntry par = p;
            while (par != null) {
                par.size--;
                par = par.parent;
            }

            TEntry replacement = (p.left != null ? p.left : p.right);
            if (replacement != null) {
                replacement.parent = p.parent;
                replacement.size = size(p.left) + size(p.right);
                if (p.parent == null)
                    root = replacement;
                else if (p == p.parent.left)
                    p.parent.left = replacement;
                else
                    p.parent.right = replacement;
                p.left = p.right = p.parent = null;
                if (p.color == BLACK)
                    fixAfterDeletion(replacement);
            } else if (p.parent == null) { // return if we are the only node.
                root = null;
            } else {
                if (p.color == BLACK)
                    fixAfterDeletion(p);

                if (p.parent != null) {
                    if (p == p.parent.left)
                        p.parent.left = null;
                    else if (p == p.parent.right)
                        p.parent.right = null;
                    p.parent = null;
                }
            }
        }

        /**
         * From CLR
         */
        private void fixAfterDeletion(TEntry x) {
            while (x != root && colorOf(x) == BLACK) {
                if (x == leftOf(parentOf(x))) {
                    TEntry sib = rightOf(parentOf(x));

                    if (colorOf(sib) == RED) {
                        setColor(sib, BLACK);
                        setColor(parentOf(x), RED);
                        rotateLeft(parentOf(x));
                        sib = rightOf(parentOf(x));
                    }

                    if (colorOf(leftOf(sib)) == BLACK &&
                            colorOf(rightOf(sib)) == BLACK) {
                        setColor(sib, RED);
                        x = parentOf(x);
                    } else {
                        if (colorOf(rightOf(sib)) == BLACK) {
                            setColor(leftOf(sib), BLACK);
                            setColor(sib, RED);
                            rotateRight(sib);
                            sib = rightOf(parentOf(x));
                        }
                        setColor(sib, colorOf(parentOf(x)));
                        setColor(parentOf(x), BLACK);
                        setColor(rightOf(sib), BLACK);
                        rotateLeft(parentOf(x));
                        x = root;
                    }
                } else { // symmetric
                    TEntry sib = leftOf(parentOf(x));

                    if (colorOf(sib) == RED) {
                        setColor(sib, BLACK);
                        setColor(parentOf(x), RED);
                        rotateRight(parentOf(x));
                        sib = leftOf(parentOf(x));
                    }

                    if (colorOf(rightOf(sib)) == BLACK &&
                            colorOf(leftOf(sib)) == BLACK) {
                        setColor(sib, RED);
                        x = parentOf(x);
                    } else {
                        if (colorOf(leftOf(sib)) == BLACK) {
                            setColor(rightOf(sib), BLACK);
                            setColor(sib, RED);
                            rotateLeft(sib);
                            sib = leftOf(parentOf(x));
                        }
                        setColor(sib, colorOf(parentOf(x)));
                        setColor(parentOf(x), BLACK);
                        setColor(leftOf(sib), BLACK);
                        rotateRight(parentOf(x));
                        x = root;
                    }
                }
            }

            setColor(x, BLACK);
        }

        static TEntry successor(TEntry t) {
            if (t == null)
                return null;
            else if (t.right != null) {
                TEntry p = t.right;
                while (p.left != null)
                    p = p.left;
                return p;
            } else {
                TEntry p = t.parent;
                TEntry ch = t;
                while (p != null && ch == p.right) {
                    ch = p;
                    p = p.parent;
                }
                return p;
            }
        }

        /**
         * Returns the predecessor of the specified Entry, or null if no such.
         */
        static TEntry predecessor(TEntry t) {
            if (t == null)
                return null;
            else if (t.left != null) {
                TEntry p = t.left;
                while (p.right != null)
                    p = p.right;
                return p;
            } else {
                TEntry p = t.parent;
                TEntry ch = t;
                while (p != null && ch == p.left) {
                    ch = p;
                    p = p.parent;
                }
                return p;
            }
        }


        int size(TEntry entry) {
            return entry == null ? 0 : entry.size;
        }

        public int v(int l0) {
            int init = l0;
            TEntry n = root;
            while (true) {
                if (n == null) {


                    out.println(init + " " + size);
                    TEntry n1 = root;
                    while (true) {
                        out.println(size(n1) + " " + size(n1.left) + " " + size(n1.right) + " " + init);
                        out.flush();
                        if (init == size(n1.left)) break;
                        if (size(n1.left) > init) {
                            n1 = n1.left;
                        } else {
                            init -= size(n1.left) + 1;
                            n1 = n1.right;
                        }
                    }


                    out.flush();
                    System.exit(-22);
                }
                if (l0 == size(n.left)) break;
                if (size(n.left) > l0) {
                    n = n.left;
                } else {
                    l0 -= size(n.left) + 1;
                    n = n.right;
                }
            }
            return n.key;
        }
    }


    private static final boolean RED = false;
    private static final boolean BLACK = true;

    static final class TEntry {
        int key;
        long value;
        TEntry left;
        TEntry right;
        TEntry parent;
        int size = 1;
        boolean color = BLACK;

        TEntry(int key, long value, TEntry parent) {
            this.key = key;
            this.value = value;
            this.parent = parent;
        }

        public long setValue(long value) {
            long oldValue = this.value;
            this.value = value;
            return oldValue;
        }
    }


    private static boolean isset(long i, int k) {
        return (i & (1 << k)) > 0;
    }

    private static void solveT() throws IOException {
        int t = sc.nextInt();
        while (t-- > 0) {
            solve();
        }
    }


    private static long gcd(long l, long l1) {
        if (l > l1) return gcd(l1, l);
        if (l == 0) return l1;
        return gcd(l1 % l, l);
    }

    private static long pow(long a, long b, long m) {
        if (b == 0) return 1;
        if (b == 1) return a;
        long pp = pow(a, b / 2, m);
        pp *= pp;
        pp %= m;
        return (pp * (b % 2 == 0 ? 1 : a)) % m;
    }


    static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        MyScanner(BufferedReader br) {
            this.br = br;
        }

        public MyScanner(InputStream in) {
            this(new BufferedReader(new InputStreamReader(in)));
        }

        void findToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }

        String next() {
            findToken();
            return st.nextToken();
        }

        Integer[] nab(int n) {
            Integer[] k = new Integer[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.fi();
            }
            return k;
        }

        int[] na(int n) {
            int[] k = new int[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.fi();
            }
            return k;
        }

        long[] nl(int n) {
            long[] k = new long[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.nextLong();
            }
            return k;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int fi() {
            String t = next();
            int cur = 0;
            boolean n = t.charAt(0) == '-';
            for (int a = n ? 1 : 0; a < t.length(); a++) {
                cur = cur * 10 + t.charAt(a) - '0';
            }
            return n ? -cur : cur;
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }


}