eolymp
bolt
Try our new interface for solving problems
Problems

Apple from the tree...

Apple from the tree...

Petya apple growing in the garden. Inspired by the story of Isaac Newton, who as we know, discovered the law of universal gravitation, after his head had fallen apple, Peter in order to improve their performance in physics often sit under the apple tree. However, as in physics at Petit solid triple, with its apple apples fall in the following way. At some point one of the apples off of the branches on which it hangs, and begins to fall straight down. If at some point it touches another apple, that is too detached from its branches and begins to fall down, and the first apple does not change the direction of its fall. In general, if any falling apple apple touches another on the way, it also begins to fall. Thus, at any time, each apple or hanging on a branch or falls straight down, and all the apples except for the first begin to fall, must first come into contact with any other incident apple. Find out which apples fall from Petya's apple. \InputFile The first line contains \textbf{N} - the number of apples on the apple Petya (\textbf{1} ≤ \textbf{N} ≤ \textbf{200}). The next \textbf{N} lines contain a description of the apples. We assume all the apples balls. Each apple given by the coordinates of its uppermost point (the one where it was originally attached to the tree, the length of the cutting neglect) \textbf{x_i}, \textbf{y_i} and \textbf{z_i} and radius \textbf{r_i} (\textbf{‑10000} ≤ \textbf{x_i}, \textbf{y_i}, \textbf{z_i} ≤ \textbf{10000}, \textbf{1} ≤ \textbf{r_i} ≤ \textbf{10000}, all of integers). It is guaranteed that no apples originally not intersect (do not touch). The axis \textbf{OZ} is directed upward. \OutputFile Output in the first row of the output file number of apples that fall from the apple, if it starts to fall first apple. The next line of output numbers of fallen apples. Apples are numbered starting with \textbf{1}, in the order in which they are defined in the input file.
Time limit 1 second
Memory limit 64 MiB
Input example #1
4
0 0 10 4
5 0 3 1
-7 4 7 1
0 1 2 6
Output example #1
3
1 2 4