Cabin Baggage

No attempts yetTime limit1sMemory limit128 MB

Problem

Cabin baggage is a bag that a passenger may bring into the cabin. It is also called carry on or hand baggage. For safety, cabin baggage must not be too heavy or too big. Each airline sets its own size and weight limits for cabin baggage, following the IATA (International Air Transport Association) guidelines.

ICPC Airline uses the limits below. The size check passes when at least one of the following two conditions holds.

  • The length is at most 56 cm, the width is at most 45 cm, and the depth is at most 25 cm.
  • The sum of the three sides (length + width + depth) is at most 125 cm.

The weight must not exceed 7 kg. Only a bag that passes both the size check and the weight check may go into the cabin. Every limit includes its boundary, so a measurement exactly equal to a limit is allowed.

The airline measures each bag with a high precision laser device. The device reports the length (cm), the width (cm), the depth (cm) and the weight (kg) as four positive numbers with two decimal places.

Write a program that decides, for each bag, whether it may go into the cabin.

Input

The first line contains the number of bags to check, tt (1t3001 \le t \le 300).

Each of the next tt lines contains the measurements of one bag: the length, the width, the depth and the weight, in that order. All four values are positive numbers with two decimal places.

Output

For each bag, print 1 on its own line if it may go into the cabin and 0 otherwise. On the last line, print how many bags may go into the cabin.