Bubbling stops at a node that calls stopPropagation. Input: line 1 — bubble path target→root as JSON array; line 2 — the node that stops propagation (or none). Print the nodes whose handlers actually fire, one per line.
Input: two lines. Output: fired nodes in order.
Your program reads from stdin and prints to stdout.
Example 1
Input: ["button","form","body"] form
Output: button form
Hints
Bubbling stops at a node that calls stopPropagation. Input: line 1 — bubble path target→root as JSON array; line 2 — the node that stops propagation (or none). Print the nodes whose handlers actually fire, one per line.
Input: two lines. Output: fired nodes in order.
Your program reads from stdin and prints to stdout.
Example 1
Input: ["button","form","body"] form
Output: button form
Hints