The organizers of the Lemon Cup are planning to prepare prizes for the contest. There are types of prizes in total, and each type is numbered from to . Initially, the quantity of every prize is .
Jaewon wants to use these prizes to create gift bundles. A single gift bundle must contain two or more consecutively numbered prizes, and exactly one prize of each included type is used.
The following two types of queries are given.
1 l r k: Purchase items for each of the prizes numbered . However, if , it means items of each corresponding prize have been discarded.Every time a type 2 query is given, print the answer of the query.
The input is given in the following format.
Every time a type 2 query is given, print the answer of the query, separated by new line.
2 l r: Print the minimum number of gift bundles that can be made by using all the prizes numbered . At this time, only the prizes numbered must be used. If it is impossible to make gift bundles using all the prizes, print -1.Each () is in one of the following two formats.