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.*;

/*
polyakoff
*/

public class Main {

    static FastReader in;
    static PrintWriter out;
    static Random rand = new Random();
    static final int oo = (int) 1e9 + 10;
    static final long OO = (long) 2e18 + 10;
    static final int MOD = (int) 1e9 + 7;

    static class SplayTree {
        class Node {
            int key, size;
            Node parent, left, right;

            Node(int key, Node parent) {
                this.key = key;
                this.parent = parent;
                size = 1;
                left = right = null;
            }

            void upd() {
                size = 1 + sizeOf(left) + sizeOf(right);
            }
        }
        Node root;

        int sizeOf(Node x) {
            return x != null ? x.size : 0;
        }

        Node findNode(Node x, int key) {
            Node last = x;
            while (x != null) {
                last = x;
                if (x.key == key)
                    return x;
                if (key < x.key)
                    x = x.left;
                else
                    x = x.right;
            }
            return last;
        }

        void rightRotate(Node x) {
            Node y = x.left;
            if (x.parent != null) {
                if (x == x.parent.left)
                    x.parent.left = y;
                else
                    x.parent.right = y;
            }
            y.parent = x.parent;
            x.left = y.right;
            if (y.right != null)
                y.right.parent = x;
            y.right = x;
            x.parent = y;
            x.upd();
            y.upd();
        }

        void leftRotate(Node x) {
            Node y = x.right;
            if (x.parent != null) {
                if (x == x.parent.left)
                    x.parent.left = y;
                else
                    x.parent.right = y;
            }
            y.parent = x.parent;
            x.right = y.left;
            if (y.left != null)
                y.left.parent = x;
            y.left = x;
            x.parent = y;
            x.upd();
            y.upd();
        }

        void splay(Node x) {
            while (x.parent != null) {
                if (x.parent.parent == null) {
                    if (x == x.parent.left)
                        rightRotate(x.parent);
                    else
                        leftRotate(x.parent);
                } else {
                    if (x == x.parent.left) {
                        if (x.parent == x.parent.parent.left) {
                            rightRotate(x.parent.parent);
                            rightRotate(x.parent);
                        } else {
                            rightRotate(x.parent);
                            leftRotate(x.parent);
                        }
                    } else {
                        if (x.parent == x.parent.parent.right) {
                            leftRotate(x.parent.parent);
                            leftRotate(x.parent);
                        } else {
                            leftRotate(x.parent);
                            rightRotate(x.parent);
                        }
                    }
                }
            }
        }

        Node merge(Node x1, Node x2) {
            if (x1 == null)
                return x2;
            if (x2 == null)
                return x1;
            Node x = findNode(x1, oo);
            splay(x);
            x.right = x2;
            x.upd();
            x2.parent = x;
            return x;
        }

        Node[] split(Node x, int key) {
            if (x == null)
                return new Node[]{null, null};
            Node x1, x2 = findNode(x, key);
            splay(x2);
            if (key <= x2.key) {
                x1 = x2.left;
                if (x1 != null)
                    x1.parent = null;
                x2.left = null;
                x2.upd();
            } else {
                x1 = x2;
                x2 = x1.right;
                if (x2 != null)
                    x2.parent = null;
                x1.right = null;
                x1.upd();
            }
            return new Node[]{x1, x2};
        }

        boolean insert(int key) {
            Node[] x = split(root, key);
            if (x[1] != null && x[1].key == key) {
                root = x[1];
                root.left = x[0];
                root.upd();
                if (x[0] != null)
                    x[0].parent = root;
                return false;
            }
            root = new Node(key, null);
            root.left = x[0];
            root.right = x[1];
            root.upd();
            if (x[0] != null)
                x[0].parent = root;
            if (x[1] != null)
                x[1].parent = root;
            return true;
        }

//        boolean insert2(int key) {
//            if (root == null) {
//                root = new Node(key, null);
//                return true;
//            }
//            Node x = findNode(root, key);
//            if (x.key == key) {
//                splay(x);
//                root = x;
//                return false;
//            }
//            Node y = new Node(key, x);
//            if (key < x.key)
//                x.left = y;
//            else
//                x.right = y;
//            x.upd();
//            splay(y);
//            root = y;
//            return true;
//        }

        boolean delete(int key) {
            if (root == null)
                return false;
            Node x = findNode(root, key);
            splay(x);
            if (x.key != key) {
                root = x;
                return false;
            }
            Node x1 = x.left;
            Node x2 = x.right;
            if (x1 != null)
                x1.parent = null;
            if (x2 != null)
                x2.parent = null;
            root = merge(x1, x2);
            return true;
        }

        void build(ArrayList<Integer> keys) {
            Node x = null;
            for (int i = 0; i < keys.size(); i++) {
                Node y = new Node(keys.get(i), null);
                if (x != null) {
                    y.left = x;
                    y.upd();
                    x.parent = y;
                }
                x = y;
            }
            root = x;
        }

        int kth(int k) {
            if (k < 0 || k >= size())
                return -1;
            Node x = root;
            while (true) {
                int ind = sizeOf(x.left);
                if (ind == k) {
                    splay(x);
                    root = x;
                    return root.key;
                }
                if (k < ind)
                    x = x.left;
                else {
                    x = x.right;
                    k -= ind + 1;
                }
            }
        }

        ArrayList<Integer> cutRange(int l, int r) {
            Node[] x1 = split(root, l);
            Node[] x2 = split(x1[1], r + 1);
            root = merge(x1[0], x2[1]);
            ArrayList<Integer> list = new ArrayList<>();
            inorder(x2[0], list);
            return list;
        }

        void inorder(Node x, ArrayList<Integer> list) {
            if (x == null)
                return;
            inorder(x.left, list);
            list.add(x.key);
            inorder(x.right, list);
        }

        ArrayList<Integer> inorder() {
            ArrayList<Integer> list = new ArrayList<>();
            inorder(root, list);
            return list;
        }

        int size() {
            return sizeOf(root);
        }
    }

    static void solve() {
        int n = in.nextInt();
        int m = in.nextInt();
        char[] s = in.next().toCharArray();

        ArrayList<Integer>[] pos = new ArrayList[256];
        SplayTree[] trees = new SplayTree[256];
        for (int i = 0; i < 256; i++) {
            pos[i] = new ArrayList<>();
            trees[i] = new SplayTree();
        }
        for (int i = 0; i < n; i++) {
            pos[0].add(i + 1);
            pos[s[i]].add(i + 1);
        }
        for (int i = 0; i < 256; i++) {
            trees[i].build(pos[i]);
        }

        for (int i = 0; i < m; i++) {
            int l = in.nextInt();
            int r = in.nextInt();
            char c = in.next().charAt(0);
            l = trees[0].kth(l - 1);
            r = trees[0].kth(r - 1);
            ArrayList<Integer> cut = trees[c].cutRange(l, r);
            for (int x : cut) {
                trees[0].delete(x);
            }
        }

        ArrayList<Integer> list = trees[0].inorder();
        for (int x : list) {
            out.print(s[x - 1]);
        }
        out.println();


    }

    public static void main(String[] args) {
        in = new FastReader();
        out = new PrintWriter(System.out);

        int T = 1;
//        T = in.nextInt();
        while (T-- > 0)
            solve();

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

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        FastReader() {
            this(System.in);
        }
        FastReader(String file) throws FileNotFoundException {
            this(new FileInputStream(file));
        }
        FastReader(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String next() {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(nextLine());
            }
            return st.nextToken();
        }
        String nextLine() {
            String line;
            try {
                line = br.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }
    }
}