## Problem J. Judging tires ≡

• problems
 Author: A. Zhuplev Time limit: 1 sec Input file: input.txt Memory limit: 256 Mb Output file: output.txt

### Statement

According to ISO stadnard Metric tire code, tire dimensions are described by a string of letters and numbers in the following format:

• 3-digit nonzero number: The nominal section width of the tire in millimeters, the widest point from both outer edges.
• /: Slash character for separation.
• 2- or 3-digit nonzero number: The aspect ratio of the sidewall height to the nominal section width of the tire, as a percentage.
• Letter R indicating radial construction of the fabric carcass of the tire.
• 2-digit nonzero number: Diameter in inches of the wheel disk that the tires are designed to fit.

Rules of ACM (Any Car Modification) race specify a fixed tire dimensions for all participating cars. Young racer Vasya has not been able to find this type of tire. However, his car will still be approved for the race by judges only if radius of the wheel (wheel disk radius plus sidewall height) differs by at most K percent from that of the specified tire.

Note: 1 inch = 25.4 millimeters. Number a differs from b by at most c percent when 100 × |a − b| / b ≤ c.

### Input file format

First line of input file contains integer K.

Second and third lines contain Metric tire codes of specified tire and Vasya's tire respectively. Tire codes contain only digits, R and slash (ASCII 47) characters.

### Output file format

Output file must contain a single string — APPROVED if Vasya's car is approved to the race or DISAPPROVED otherwise.

0 ≤ K ≤ 100

### Sample tests

No. Input file (input.txt) Output file (output.txt)
1
2
195/65R15
205/55R15
DISAPPROVED
2
1
195/65R15
185/070R15
APPROVED

0.066s 0.008s 15