14990 - RedCapeFlyingCat's Nested Rectangles 2   

Description

Two axis-aligned rectangles and are given. Determine their relationship:

  • If contains (a rectangle's own boundary counts as part of it), output A.
  • Otherwise, if contains , output B.
  • Otherwise, and overlap (their intersection has positive area); output Overlap.

If and are identical, output A. It is guaranteed that and always have a positive-area intersection, so the answer is always A, B, or Overlap.

Note

The image below is the sample test case.

Subtasks

Testcase Constraints
1-5 The answer is guaranteed to be A or B.
6-10 No additional constraint.

Input

Eight lines, each with one integer. For a rectangle , its bottom-left corner is and its top-right corner is ( increases rightward, increases upward).

  • Line 1:
  • Line 2:
  • Line 3:
  • Line 4:
  • Line 5:
  • Line 6:
  • Line 7:
  • Line 8:

Constraint:

  • and (likewise for ): rectangles are never degenerate
  • and always have a positive-area intersection

Output

One line containing A, B, or Overlap.

Sample Input  Download

Sample Output  Download

Tags




Discuss