An irrigation controller tracks which stretches of a pipe are currently watered. Positions are integers and a stretch is a half-open interval [l, r) (covering every point from l up to but not including r). Starting with nothing watered, it processes q operations, each one of:
ADD l r— mark every point in[l, r)as watered.REMOVE l r— mark every point in[l, r)as not watered.QUERY l r— report1if every point in is currently watered, otherwise .
Input format
Line 1: an integer q.
Next q lines: ADD l r, REMOVE l r, or QUERY l r, with 0 <= l < r <= 60.
Output format
For each QUERY operation, in order, print 1 or 0 on its own line.
Constraints
- 1 <= q <= 40
- 0 <= l < r <= 60