CSES - A11 limited universe
  • Time limit: 2.00 s
  • Memory limit: 100 MB

In the (fixed) project template from task A00, implement a data structure that supports fast insertions and queries when the universe size is sufficiently limited. That is, queries or insertions will never target elements greater than k for some reasonably small k.

This version should be used when either the "-t 5" and the "-l <k>" command line arguments are present, or when the "-l <k>" argument is present with sufficiently small value.

Input

Sequence of non-negative integers for queries or insertions, with "-1" switching between insert and query modes.

Output

Query results. 1 if the queried integer is present in the set or 0 if it is not.

Constraints

  • Queries and insertions are in the range [0..k].
  • The number of queries will be less than 10^8.
  • k will be less than 10^8.

Example

Input:

2 4 6 8 10 -1 3 4 5 6 7

Output:

0
1
0
1
0