Skip to main content
Back to problems
Codeforces
Easy
Math
Greedy
Simulation
Lever

Given the lengths of a lever's left and right arms, determine whether it is balanced, tips left, or tips right.

Acceptance 0%
Also Available On
Other platform versions and source mappings for the same problem.
Problem Statement

Problem

You are given two positive integers representing the lengths of the left and right arms of a lever.

A lever is:

  • balanced if the two arms have the same length,
  • left-heavy if the left arm is longer,
  • right-heavy if the right arm is longer.

Print the appropriate result based on the comparison.

Task

Read the two lengths and output the direction in which the lever would tilt, or that it is balanced.

Input Format

  • A single line contains two integers ll and rr — the lengths of the left and right arms.

Output Format

  • Print Balanced if l=rl = r.
  • Print Left if l>rl > r.
  • Print Right if l<rl < r.

Constraints

  • 1l,r1091 \le l, r \le 10^9
Examples
Sample cases returned by the problem API.

Example 1

Input

5 5

Output

Balanced

Explanation

Both arms have the same length, so the lever is balanced.

Example 2

Input

7 3

Output

Left

Explanation

The left arm is longer, so the lever tilts left.

Show 1 more example

Example 3

Input

2 9

Output

Right

Explanation

The right arm is longer, so the lever tilts right.

Premium problem context

Unlock deeper context for this problem

Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.

Guided hints
Editorial and discussion links
Concept map and variants
Sign in to unlock
Track your progress
Sign in to bookmark this problem, save notes, and manage its revision plan.