You are given a main list of entries that consists of 3D points where each point has a unique integer ID, , that corresponds to an coordinate value. You are also given a bucket size, . Then sort the main list by decreasing value (it is guaranteed that the value is distinct), remove the first points, and put them in the bucket. Next, you must perform an unknown number () of queries in the following form:

  • F k or f k: Find point in the bucket. If the point exists in the bucket, print k = (x,y,z) where is the point ID and are the point's coordinates; otherwise, print Point doesn’t exist in the bucket..
  • R k or r k: Remove point from the bucket. Then remove the next item in the main list (i.e., the item having the maximal value) and add it to the bucket; otherwise print one of the following (depending on the current state):
    • If the point is not found in the bucket, print Point doesn’t exist in the bucket..
    • If the point exists in the bucket but there are no more points in the main list to replenish the bucket once it's removed, print No more points can be deleted..

Note: You must maintain a bucket size of at all times.

Input Format

The first line contains two space-separated integers denoting the respective values of (the number of IDs) and (the bucket size).
Each of the subsequent lines contains four space-separated numbers where the first number is an integer denoting a point ID, , followed by three double values (up to three points after the decimal) representing the respective , , and coordinates corresponding to point .

This is followed by some unknown number of lines of queries. Each query is a single line of two space-separated values, where the first value is a case-insensitive letter (either F or R) followed by an integer, , denoting a point ID. The letter F denotes a find query and the letter R denotes a remove query.

Constraints

  • (up to three points after the decimal)

Output Format

Process the queries in order and print the result for each query on a new line.

For a find (F) query, if the point with the given ID is found, print k = (x,y,z) where is the point ID and are the values for that point (rounded to 3 decimal places); otherwise, print Point doesn’t exist in the bucket.

For a remove (R) query, if the point with the given ID is found and removed successfully, print Point id k removed. where is the ID of the removed point; otherwise, print one of the following (depending upon the program’s current state):

  • If the point is not found in the bucket, print Point doesn’t exist in the bucket..
  • If the point exists in the bucket but there are no more points in the main list to replenish the bucket once it's removed, print No more points can be deleted..

Sample Input

4 2
1 25.5 50.2 -60.5
2 12.2 60.2 -75.89
3 65.1 25.6 -55.9
4 22.6 12.6 -30.8
F 3
F 2
R 2
R 4
R 1
R 2

Sample Output

3 = (65.100,25.600,-55.900)
Point doesn't exist in the bucket.
Point doesn't exist in the bucket.
Point id 4 removed.
Point id 1 removed.
No more points can be deleted.

Explanation

Our bucket has size so we fill it with the first two points having the largest values: and . We perform six queries:

  1. Find point in the bucket. corresponds to point , so we print 3 = (65.100,25.600,-55.900) on a new line.
  2. Find point in the bucket. This point is still in the main list and not in the bucket, so we print Point doesn't exist in the bucket. on a new line.
  3. Remove point from the bucket. This point is still in the main list and not in the bucket, so we print Point doesn't exist in the bucket. on a new line.
  4. Remove point from the bucket. This point is in the bucket, so we remove it and print Point id 4 removed. on a new line. Then, we add the point with the next-largest value to the bucket (i.e., ) so that the bucket now contains points and ..
  5. Remove point from the bucket. This point is in the bucket, so we remove it and print Point id 1 removed. on a new line. Then, we add the point with the next-largest value to the bucket (i.e., ) so that the bucket now contains points and .
  6. Remove point from the bucket. Because the point exists in the bucket but no more points can be removed from the main list to replenish the bucket, we print No more points can be deleted. on a new line.
Loading Editor...
  1. Challenge Walkthrough
    Let's walk through this sample challenge and explore the features of the code editor.1 of 6
  2. Review the problem statement
    Each challenge has a problem statement that includes sample inputs and outputs. Some challenges include additional information to help you out.2 of 6
  3. Choose a language
    Select the language you wish to use to solve this challenge.3 of 6
  4. Enter your code
    Code your solution in our custom editor or code in your own environment and upload your solution as a file.4 of 6
  5. Test your code
    You can compile your code and test it for errors and accuracy before submitting.5 of 6
  6. Submit to see results
    When you're ready, submit your solution! Remember, you can go back and refine your code anytime.6 of 6
  1. Check your score