Vasya is organizing another contest for the spring All-Berland programming camp. As a fan of lively gatherings and with the weather encouraging such activities, he finds himself with limited time for preparation. To make the most of his time, he needs to quickly navigate from one directory to another. Vasya is so accustomed to his favorite file manager, "Near Commandir," that using any other software would slow him down significantly. This manager allows him to perform several basic operations: move up or down one position in the list of files and subdirectories, enter the currently highlighted subdirectory, or move up one level in the directory tree if it's the parent directory. Each of these operations takes Vasya exactly second. To expedite his navigation, Vasya can also reorder the files and subdirectories in the current directory, which takes seconds. Files can be sorted by name, size, or last modification time. For the latter two, files with the same size or time are sorted by name. File and directory names within the same directory are unique. Vasya wants to determine how much time it will take to reach the desired file from his current location in the file system tree. Initially, files in the current directory are sorted by name, and when entering a new directory, they are also sorted by name without any additional time cost for Vasya.
The file system is represented as a tree with a specified root. The first line contains and (1 \leq n \leq 100000, 0 \leq t \leq 10) — the size of the tree and the time required to change the order of files. The following lines each contain values: p_i, name_i, fsize_i, date_i (1 \leq i \leq n. p_i is the ancestor node number; if it is , this node is the root. name_i is the file name, a non-empty string of up to Latin letters. fsize_i is the file size, 0 \leq fsize_i \leq 10000. date_i is the last modification time, 0 \leq date_i \leq 10000). The last line contains two numbers 0 \leq s, f < n — the node number where Vasya currently is and the node number he needs to reach. Nodes are numbered in the order they appear in the input.
Output a single integer representing the minimum number of seconds required.
Example 1