Problem:


Score : 100 points

Problem Statement

A balance scale tips to the left if L>R, where L is the total weight of the masses on the left pan and R is the total weight of the masses on the right pan. Similarly, it balances if L=R, and tips to the right if L<R.

Takahashi placed a mass of weight A and a mass of weight B on the left pan of a balance scale, and placed a mass of weight C and a mass of weight D on the right pan.

Print Left if the balance scale tips to the left; print Balanced if it balances; print Right if it tips to the right.

Constraints

1\leq A,B,C,D \leq 10

All input values are integers.

Input

Input is given from Standard Input in the following format:

A B C D

Output

Print Left if the balance scale tips to the left; print Balanced if it balances; print Right if it tips to the right.

Sample Input 1

3 8 7 1

Sample Output 1

Left

The total weight of the masses on the left pan is 11, and the total weight of the masses on the right pan is 8. Since 11>8, we should print Left.

Sample Input 2

3 4 5 2

Sample Output 2

Balanced

The total weight of the masses on the left pan is 7, and the total weight of the masses on the right pan is 7. Since 7=7, we should print Balanced.

Sample Input 3

1 7 6 4

Sample Output 3

Right

The total weight of the masses on the left pan is 8, and the total weight of the masses on the right pan is 10. Since 8<10, we should print Right.



Sample input:
3 8 7 1


Sample output:
Left

Submission status: Accepted

Solution code:
def main():
    A, B, C, D = map(int, input().split())
    l = A + B
    r = C + D
    if l > r:
        print("Left")
    elif l == r:
        print("Balanced")
    else:
        print("Right")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
A,B,C,D = map(int,input().split())
if(A+B == C+D):
    print("Balanced")
elif(A+B<C+D):
    print("Right")
elif(A+B>C+D):
    print("Left")

Submission status: Accepted

Solution code:
A, B, C, D = map(int, input().split())

if A+B > C+D:
    print("Left")
elif A+B == C+D:
    print("Balanced")
else:
    print("Right")

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
ans = "Left" if a+b>c+d else "Right" if a+b<c+d else "Balanced"
print(ans)

Submission status: Accepted

Solution code:
a = [int(x) for x in  input().split()]

if (a[0]+a[1] > a[2]+a[3]):
    print("Left")
elif (a[0]+a[1] < a[2]+a[3]):
    print("Right")
else:
    print(("Balanced"))

Submission status: Accepted

Solution code:
w=list(map(int,input().split(" ")))
l=w[0]+w[1]
r=w[2]+w[3]

if l>r:
    print("Left")
elif l==r:
    print("Balanced")
else:
    print("Right")

Submission status: Accepted

Solution code:
a, b, c, d = map(int, raw_input().split(" "))
if a+b == c+d:
    print "Balanced"
elif a+b > c+d:
    print "Left"
else:
    print "Right"

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
A,B,C,D=[int(i) for i in input().split()]



if A+B > C+D:
    print("Left")
elif A+B < C+D:
    print("Right")
else:
    print("Balanced")

Submission status: Accepted

Solution code:
A, B, C, D = list(map(int, input().split()))
if A + B > C + D:
    print("Left")
elif A + B < C + D:
    print("Right")
else:
    print("Balanced")

Submission status: Accepted

Solution code:
import sys

line = sys.stdin.readline().strip()
a, b, c, d = [int(x) for x in line.split()]

if a + b == c + d:
    print("Balanced")
elif a + b > c + d:
    print("Left")
else:
    print("Right")

Submission status: Accepted

Solution code:
a=[int(i) for i in input().split()]
if a[0]+a[1] > a[2]+a[3]:
  print("Left")
elif a[0]+a[1] < a[2]+a[3]:
  print("Right")
else:
  print("Balanced")

Submission status: Accepted

Solution code:
a, b, c, d = [int(x) for x in input().split()]
left = a + b
right = c + d
if left > right:
    print("Left")
elif left == right:
    print("Balanced")
else:
    print("Right")

Submission status: Accepted

Solution code:
a,b,c,d=[int(i) for i in input().split(" ")]

if a+b==c+d:
  print('Balanced')
elif a+b>c+d:
  print('Left')
else:
  print('Right')

Submission status: Accepted

Solution code:
def main():
    A, B, C, D = map(int, input().split())

    if A + B > C + D:
        print('Left')
    elif A + B < C + D:
        print('Right')
    else:
        print('Balanced')

main()

Submission status: Accepted

Solution code:
a,b,c,d=[int(i) for i in input().split()]

if a+b==c+d:
    print('Balanced')
elif a+b>c+d:
    print('Left')
else:
    print('Right')

Submission status: Accepted

Solution code:
def a():
    a, b, c, d = map(int, input().split())
    if a + b > c + d:
        print('Left')
    elif a + b < c + d:
        print('Right')
    else:
        print('Balanced')


if __name__ == '__main__':
    a()

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

a, b, c, d = [int(i) for i in input().split()]
l = a + b
r = c + d

if l > r:
    print('Left')
elif l < r :
    print('Right')
else:
    print('Balanced')

Submission status: Accepted

Solution code:
A,B,C,D = [int(i) for i in input().split()]
x=A+B
y=C+D
if x>y:
  print('Left')
elif x<y:
  print('Right')
else:
  print('Balanced')

Submission status: Accepted

Solution code:
print (lambda a,b,c,d: "Left" if a+b>c+d else "Right" if a+b<c+d else "Balanced")(*map(int, raw_input().split()))

Submission status: Accepted

Solution code:
a, b, c, d = map(int,input().split())

if a + b > c + d :
    print("Left")
elif a + b < c + d:
    print("Right")
else:
    print("Balanced")

Submission status: Accepted

Solution code:
#coding:utf-8                                                              

A, B, C, D = map(int, raw_input().split())

if A+B > C+D:
    print 'Left'
elif A+B == C+D:
    print 'Balanced'
else:
    print 'Right'

Submission status: Accepted

Solution code:
if __name__=="__main__":
    l = list(map(int,input().split(" ")))
    if l[0]+l[1]>l[2]+l[3]:
        print('Left')
    elif l[0]+l[1]<l[2]+l[3]:
        print('Right')
    else:
        print('Balanced')

Submission status: Accepted

Solution code:
A, B, C, D=map(int,input().split(' '))

if A+B>C+D:
    print('Left')
elif A+B==C+D:
    print('Balanced')
else:
    print('Right')

Submission status: Accepted

Solution code:
inputs = input().split()
A = int(inputs[0])
B = int(inputs[1])
C = int(inputs[2])
D = int(inputs[3])

if A+B > C+D:
    print('Left')
elif A+B < C+D:
    print('Right')
else:
    print('Balanced')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-       

a = list(map(int,input().split()))

l = a[0] + a[1]
r = a[2] + a[3]

if(l>r):
    print('Left')
elif(l==r):
    print('Balanced')
else:
    print('Right')

Submission status: Accepted

Solution code:
a, b, c, d = map(int, raw_input().split())

if a + b < c + d:
    print "Right"
elif a + b > c + d:
    print "Left"
else:
    print "Balanced"

Submission status: Accepted

Solution code:
a, b, c, d = map(int,input().split())
s = a + b
t = c + d

if s > t:
    print("Left")
elif s < t:
    print("Right")
else:
    print("Balanced")

Submission status: Accepted

Solution code:
A, B , C , D = map(int, input().split())

if (A+B) > (C+D):
    print("Left")
elif (A+B) < (C+D):
    print("Right")
else:
    print("Balanced")

Submission status: Accepted

Solution code:
a, b, c, d = list(map(int, input().split()))

if (a+b) < (c+d):
    print ('Right')
elif (a+b) > (c+d):
    print ('Left')
else:
    print ('Balanced')

Submission status: Accepted

Solution code:
A, B, C, D=map(int,input().split())
if A+B > C+D:
    print("Left")
elif A+B == C+D:
    print("Balanced")
else:
    print("Right")

Submission status: Accepted

Solution code:
import sys
a, b, c, d = map(int, sys.stdin.readline().split())
if a+b > c+d:
    print('Left')
elif a+b == c+d:
    print('Balanced')
else:
    print('Right')

Submission status: Accepted

Solution code:
a, b, c, d = map(int, raw_input().split())
print 'Left' if a + b > c + d else 'Balanced' if a + b == c + d else 'Right'

Submission status: Accepted

Solution code:
a,b,c,d=input().split()
if((int(a)+int(b))>(int(c)+int(d))):
    print('Left')
elif((int(a)+int(b))<(int(c)+int(d))):
    print('Right')
else:
    print('Balanced')

Submission status: Accepted

Solution code:
a, b, c, d = map(int,input().split())
l = a+b
r = c + d
if l > r:
    print('Left')
elif l < r:
    print('Right')
else:
    print('Balanced')

Submission status: Accepted

Solution code:
def main():
    A, B, C, D = map(int, input().split())
    hoge = A + B
    fuga = C + D

    if hoge > fuga:
        print("Left")
    elif hoge == fuga:
        print("Balanced")
    else:
        print("Right")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a,b,c,d=[int(i) for i in input().split()]
if a+b>c+d:
  print("Left")
elif a+b<c+d:
  print("Right")
else:
  print("Balanced")

Submission status: Accepted

Solution code:
A, B, C, D = map(int, input().split())
if A+B > C+D:
  print("Left")
elif A+B < C+D:
  print("Right")
else:
  print("Balanced")

Submission status: Accepted

Solution code:

a, b, c, d = list(map(int, input().split()))

if a + b > c + d:
    print("Left")
elif a + b < c + d:
    print("Right")
else:
    print("Balanced")

Submission status: Accepted

Solution code:
a,b,c,d = [int(i) for i in input().split()]
if a + b == c + d:
  print('Balanced')
elif a + b > c + d:
  print('Left')
else:
  print('Right')

Submission status: Accepted

Solution code:
a,b,c,d = map(int,input().split())
l = a+b
r = c+d
if l > r:
	print('Left')
elif l == r:
	print('Balanced')
else:
	print('Right')

Submission status: Accepted

Solution code:
A, B, C, D = map(int, input().split())
if A+B == C+D:
    print("Balanced")
elif A+B > C+D:
    print("Left")
else:
    print("Right")

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
l = a + b
r = c + d
if l > r:
  print('Left')
elif l < r:
  print('Right')
else:
  pritn('Balanced')

Submission status: Runtime Error

Solution code:
A,B,C,D=map(int,input(),split())
if A+B>C+D:
  print("Left")
elif:
  A+B<C+D:
    print("Right")
else:
  print("Balanced")

Submission status: Runtime Error

Solution code:
ans = 0
n, a, b = map(int, input().split())
for i in range(1, n + 1):
  t = 0
  z = i
  while z > 0:
    t = t + z % 10
    z = z // 10
  if t >= a and t <= b:
    ans = ans + i
print(ans)

Submission status: Runtime Error

Solution code:
N,A,B = map(int,input().split())
K = 0
for i in range(1,N+1):
  if A <= sum(list(map(int,str(i)))) <= B:
    K += i
print(K)

Submission status: Runtime Error

Solution code:
from sys import stdin
n, a, b = [int(x) for x in stdin.readline().rstrip().split()]
sum = 0

for x in range(1,n+1):
   l = x // 10000
   m = (x % 10000) // 1000
   n = (x % 1000) // 100
   o = (x % 100) // 10
   p = x % 10
   if l+m+n+o+p >= a and l+m+n+o+p <= b:
      sum += x

print(sum)

Submission status: Runtime Error

Solution code:
N,A,B = input().split()
N,A,B = map(int,(N,A,B))
f=0
for i in range(1,N+1):
  k=i
  a = i//10000
  i = i-a*10000
  b = i//1000
  i = i-b*1000
  c = i//100
  i = i-c*100
  d = i//10
  i = i-d*10
  e = i
  s = a+b+c+d+e
  if A<=s<=B:
    f += k
print(f)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
infos = []
for i in range(N):
  infos.append([int(s) for s in input().split()])

def check():
    c_t = 0
    c_x = 0
    c_y = 0
    for info in infos:
      n_t = info[0]
      n_x = info[1]
      n_y = info[2]

      d_t = n_t - c_t
      d_x = n_x - c_x
      d_y = n_y - c_y
      if d_t < (d_x + d_y):
        return "No"

      if (d_t - (d_x+d_y)) % 2 != 0:
        return "No"
      c_t = n_t
      c_x = n_x
      c_y = n_y
    return "Yes"

print(check())

Submission status: Runtime Error

Solution code:
n,a,b=map(int,input().split())

count=0

for i in range(n+1):
    if a<=sum(map(int,str(i)))<=b:
        count+=i

print(count)

Submission status: Runtime Error

Solution code:
a, b, c, d=map(int,input().split())
if a+b<c+d:
  print("Right")
elif a+b=c+d:
  print("Balanced")
else:
  print("Left")

Submission status: Runtime Error

Solution code:
a, b, c, d=map(int,input().split())
if (a+b<c+d):
  print("Right")
elif (a+b=c+d):
  print("Balanced")
else:
  print("Left")

Submission status: Runtime Error

Solution code:
a, b, c, d=map(int,input().split())
if (a+b<c+d):
  print("Right")
elif(a+b=c+d):
  print("Balanced")
else:
  print("Left")

Submission status: Runtime Error

Solution code:
n,a,b = map(int, input().split())
ans = 0
for i in range(1,n+1):
    if a <= sum([int(c) for c in str(i)]) <= b:
        ans += i
print(ans)

Submission status: Runtime Error

Solution code:
from functools import reduce

n,a,b = map(lambda x:int(x),input().split(" "))

ans = 0
for ni in range(a,n+1):
    add_each_dig = reduce(lambda x, y: int(x) + int(y), str(ni) )
    if a <= add_each_dig and add_each_dig <= b:
        ans += ni

print(ans)

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
print([["Balanced,"Left"][a+b>c+d],"Right"][a+b<c+d])

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
[["Balanced,"Left"][a+b>c+d],"Right"][a+b<c+d]

Submission status: Runtime Error

Solution code:
A = input()
B = input()
C = input()
D = input()
L = int(A)+int(B)
R = int(C)+int(D)
if L>R:
  print("Left")
elif L == R:
  print("Balanced")
else :
  print("Right")

Submission status: Runtime Error

Solution code:
A = input()
B = input()
C = input()
D = input()
L = str(A)+str(B)
R = str(C)+str(D)
if L>R:
  print("Left")
elif L == R:
  print("Balanced")
else :
  print("Right")

Submission status: Runtime Error

Solution code:
A = 10
B= 1
C= 2
D= 3
L = A + B
R = C + D
if L > R:
  print(Left)
elif L == R:
  print(Balanced)
else :
  print(Right)

Submission status: Runtime Error

Solution code:
N,A,B = map(int,input().split())
a=0
b=0
c=0
d=0
e=0
y=0
for i in range(1,N+1,1):
  n = str(i)
 
  if int(n)==10000:
    e=n[0]
  if 1000<=int(n)<10000:
    d=n[0]
    c=n[1]
    b=n[2]
    a=n[3]
  if 100<=int(n)<1000:
    c=n[0]
    b=n[1]
    a=n[2]
  if 10<=int(n)<100:
    b=n[0]
    a=n[1]
  if int(n)<10:
    a=n[0]
  x = int(d) + int(c) + int(b) + int(a) + int(e)
  if A <= x <= B:
    y = y + int(n)
print(y)

Submission status: Runtime Error

Solution code:
A,B,C,D=map(int, input().split())
if A+B>C+D:
  print('Left')
elif A+B>C+D::
  print('Right')
else:
  print('Balanced')

Submission status: Runtime Error

Solution code:
A, B, C, D = map(int, input())
print("Right" if (A+B) < (C+D) else "Balanced" if (A+B) == (C+D) else "Left")

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
souryou=0
for i in range(N):
  j=i+1
  j_str=str(j)
  goukei=0
  for k in range(len(j_str)):
    goukei=goukei+int(j_str[k])
  if goukei>=A and goukei<=B:
    souryou=souryou+j
print(str(souryou))

Submission status: Runtime Error

Solution code:
A, B, C, D = [int(input()) for i in range(4)]
if A+B>C+D:
  print('Left')
elif A+B==C+D:
  print('Balanced')
elif A+B<C+D:
  print('Right')

Submission status: Runtime Error

Solution code:
if A+B>C+D:
  print('Left')
elif A+B==C+D:
  print('Balanced')
elif A+B<C+D:
  print('Right')

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline

A,B,C,D=list(map(int,input().split()))
if A+B == C+D:
    print('Balanced')
elif A+B ＞ C+D:
    print('Left')
else:
    print('Right')

Submission status: Runtime Error

Solution code:
A, B, C, D = map(int,input().split())
if A+B > C+D:
  print("Left")
elif A+B = C+D:
  print("Balanced")
else:
  print("Right")

Submission status: Runtime Error

Solution code:
I = input().split()
A, B, C, D = [int(i) for i in I]

if int(A + B > C + D:
    print('Left')
elif A + B < C + D:
    print('Right')
else:
    print('Balanced')

Submission status: Runtime Error

Solution code:
"""
B - Some Sums
"""
ans = 0
#入力される数n, a, b
N, a, b = map(int, input().split())

def digitSum(n):
    d = str(n)   #iの数値を文字列に変換 d ←　下記eにおいてitrrableなものが求められるため文字列に変換する
    #print(d)
    e = list(map(int, d))   #1文字ずつ数値化し配列にする
    #print(e)
    f = sum(e)
    return f

#print(a, b, n)
for i in range(N+1):
    digitSum(i)
    if a <= digitSum(i) <= b:
        #print(digitSum(i))
        ans += i

print(ans)

Submission status: Runtime Error

Solution code:
n, a, b = map(int, input().split())
count = 0

for i in range(1, n+1):
    if a <= sum(map(int,list(str(i)))) <= b:
        s += i
        
print(s)

Submission status: Runtime Error

Solution code:
#include<stdio.h>
int main()
{
  int a,b,c,d;
  scanf("%d%d%d%d",&a,&b,&c,&d);
  if(a+b>c+d)printf("Left\n");
  else if(a+b=c+d)printf("Balanced\n");
  else printf("Right\n");
}

Submission status: Runtime Error

Solution code:
#include<stdio.h>
int main()
{
  inf a,b,c,d;
  scanf("%d%d%d%d",&a,&b,&c,&d);
  if(a+b>c+d)printf("Left\n");
  else if(a+b=c+d)printf("Balanced\n");
  else printf("Right\n");
}

Submission status: Runtime Error

Solution code:
A,B,C,D = map(int,input().split())
if (A+B) = (C+D):
  print("Balanced")
elif (A+B) < (C+D):
  print("Right")
else:
  print("Left")

Submission status: Runtime Error

Solution code:
A,B,C,D = map(int,input().split())
if A+B = C+D:
  print("Balanced")
elif A+B < C+D:
  print("Right")
else:
  print("Left")

Submission status: Runtime Error

Solution code:
A,B,C,D = map(int,input().split())
if A+B = C+D:
  print("Balanced")
elif A+B < C+D:
  print("Right")
else:
  print("Left")

Submission status: Runtime Error

Solution code:
from math import *

def solve(x,y,ans=1):
  return 1 + ceil(log2(y/x))
  
X,Y = map(int,input().split())
print(solve(X,Y))

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
ans=0 

for i in range(1,N+1):
    D=0
    for j in str(i):
        D+=int(j)
    if A<=D<=B:
        ans+=i
print(ans)

Submission status: Runtime Error

Solution code:
A,B,C,D=map(int,input().split())

if (A+B)>(C+D):
  print('left')
elif (A+B)=(C+D):
  print('Balanced')
else:
  print('Right')

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int, input().split())
L=a+b,R=c+d
if L>R:
  print('Left')
elif L==R:
  print('Balanced')
else:
  print('Right')

Submission status: Runtime Error

Solution code:
N,A,B = map(int,input().split())

Sum = 0

for n in range(N+1):
    s = 0
    strn = str(n)
    for i in strn:
        s += int(i)
    if s >= A and s<= B:
        Sum += n

print("{}".format(Sum))

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursoinlimit(10**6)
#Some Sums 
n,a,b = int(input()), int(input()), int(input())
n_list = []
for i in range(1,n+1):
  n_list.append(str(i))

#evaluete 
acpt = []
for i in range(n):
  if len(n_list[i]) == 1:
    if a <= int(n_list[i]) <= b: acpt.append(int(n_list[i]))
    else: acpt.append(0)
  else:
    splt = []
    for j in range(len(n_list[i])):
      splt.append(int(n_list[i][j]))
    if a <= sum(splt) <= b: acpt.append(int(n_list[i]))
    else: acpt.append(0)

print(sum(acpt))

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
diff = a + b - c - d
print("Left" if diff > 0 "Balanced" if diff == 0 else "Right")

Submission status: Runtime Error

Solution code:
A, B, C, D = map(int, input().split())
print('Left' if A + B > C + D, else 'Balanced' if A + B == C + D else 'Right')

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input())
if a+b>c+d:
  print('Right')
elif (a+b)==(c+d):
  print('Balanced')
else:
  print('Left')

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#############
# Main Code #
#############

A,B,C,D = inputIL()

if A+B = C+D:
  print("Balanced")
elif A+B>C+D:
  print("Left")
else:
  print("Right")

Submission status: Runtime Error

Solution code:
l,r=map(int,input().split())
print("Left"if l>r else "Balanced"if l==r else "Right")

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split())

ans = 0


def somesum(x):
    total = 0
    while x > 0:
        total += x % 10
        x = x / 10
    return total


for i in range(N + 1):
    total = somesum(i)
    if total >= A and total <= B:
        ans += i

print(ans)

Submission status: Runtime Error

Solution code:
A,B,C,D = map(int, input().split())
# A = int(input())
# B = int(input())
# C = int(input())
# X = input()
L = A + B
R = C + D
print("Left" if L > R else "Balanced" if L = R else "Right")

Submission status: Runtime Error

Solution code:
a,b,c,d = (int(i) for i in input(.split()))

x = a + b
y = c + d

if x > y:
    print('Left')
elif x < y:
    print('Right')
else:
    print('Balanced')

Submission status: Runtime Error

Solution code:
C,D=map(int,input().split())
print("Left" if A+B > C+D else "Balanced" if A+B == C+D else "Right")

Submission status: Runtime Error

Solution code:

A, B, C, D = map(int, input().split())

print("Left" if (A+B)>(C+D) else "Balanced" if (A+B)==(C+D) else "Right

Submission status: Runtime Error

Solution code:

A, B, C, D = map(int, input().split())

print("Left" if (A+B)>(C+D) else "Balanced" if (A+B)=(C+D) else "Right

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
if a + b > c + d: print('Left')
elif a + b == c + d: print('Balanced')
else print('Right')

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
if (a + b > c + d) print('Left')
elif (a + b == c + d) print('Balanced')
else print('Right')

Submission status: Runtime Error

Solution code:
def libra(l,r):
    if l>r:
        return "Left"
    elif l == r:
        return "Balanced"
    else:
        return "Right"
def sum(a,b):
    c = a+b
    return c

a,b,c,d=[int() for  in input().split()]
print(libra(sum(a,b),sum(c,d)))

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())
sum = 0

for x in range(a+1):
    i = x // 10
    ii = x - 10 * i
    iii = i + ii
    if b <= iii and c >= iii:
        sum += x

print(sum)

Submission status: Runtime Error

Solution code:
N,A,B = map(int, input().split())
count = 0

for i in range(1,N+1):
    
    m = 0
    tmp = i
    for t in range(1, len(str(i))+1):
        #print(tmp)
        
        m += tmp%10
        tmp /= 10
        tmp = int(tmp)
    
    if( A <=m and m <= B):
        count += i

print(count)

Submission status: Runtime Error

Solution code:
A,B,C,D = map(int, input().split())

print('Left' if A+B > C+D  'Balanced' elif A+B == C+D else 'Right')

Submission status: Runtime Error

Solution code:
A,B,C,D = map(int, input().split())

print('Left' if A+B > C+D else 'Balanced' A+B == C+D else 'Right')

Submission status: Runtime Error

Solution code:
n=int(input("N="))
a=int(input("A="))
b=int(input("B="))

count=1
sum=0
while count<=n :
    ts=int(count/10000)
    #print(" "+str(ts))
    s=int(count/1000)
    #print(" "+str(s))
    h=int(count/100)
    #print(" "+str(h))
    t=int(count/10)
    #print(" "+str(t))
    o=count%10
    #print(" "+str(o))
    #print("ts+s+h+t+o="+str(ts+s+h+t+o))
    if ts+s+h+t+o >= a and ts+s+h+t+o <= b:
        sum += count
        #print(count)
    count += 1

print(sum)

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
print("balanced" if a+b=c+d else "left" if a+b>c+d else "right")

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
print("balanced" if a+b=c+d else "left" if a+b>c+d else "right" a+b<c+d)

Submission status: Runtime Error

Solution code:
n, a, b, = map(int,input().split())
ans = 0
for i in range(n+1):
    if a <= sum(list(map(int,list(str(i))))) <= b
        ans += i
print(ans)

Submission status: Runtime Error

Solution code:
n, a, b, = map(int,input().split())
ans = 0
for i in range(n+1):
    if a <= sum(list(map(int,list(str)))) <= b
        ans += i
print(ans)

Submission status: Runtime Error

Solution code:
A,B,C,D=map(int,input())
e=A+B-C-D
print("Balanced")if e==0 else print(["Left",0,"Right"][e/abs(e)])

Submission status: Runtime Error

Solution code:
A,B,C,D=map(int,input())
e=A+B-C-D
print("Balanced")if e==0 else print(["Left","Right"][e/abs(e)])

Submission status: Runtime Error

Solution code:
n,a,b = map(int, input().split())
sum = 0
for i in range(10):
  for j in range(10):
    for k in range(10):
      for l in range(10):
   	    if 1000*i + 100*j + 10*k + l <= n and a<i+j+k+l and i+j+k+l<b :
   		  sum += 1000*i + 100*j + 10*k + l
print(sum)

Submission status: Runtime Error

Solution code:
n,a,b = map(int, input().split())
sum = 0
for i in range(10):
  for j in range(10):
    num = 10*i+j
    if num <= n and a<i+j and i+j<b :
      sum += num
print(sum)

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
if a+b > c+d:
    print('Left')
elif a+b == c+d:
    print('Balanced')
else:
    print('R

Submission status: Runtime Error

Solution code:
a,b,c,d=list(map(int,input().split()))
x=a+b
y=c+d
if x>y:
  print("Left")
 elif x<y:
  print("Right")
 else:
  print("Balanced")

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
x=a+b
y=c+d
if x>y:
  print("Left")
 elif x<y:
  print("Right")
 else:
  print("Balanced")

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split())
All = 0

for i in range(1, N + 1):
    total = 0
    j = i
    while j != 0:
        total += j % 10
        j = j // 10
    if A <= total <= B:
        All += i

print(All)

Submission status: Runtime Error

Solution code:
A= input() 
B= input()
C= input()
D= input()
L=A+B
R=C+D
if L>R:
  print('Left')
elif L==R:
  print('Balanced')
else :
  print('Right')

Submission status: Runtime Error

Solution code:
A,B,C,D= map(int, input().split())
L=A+B:
R=C+D:
if L>R:
  print('Left')
elif L=R:
  print('Balanced')
else :
  print('Right')

Submission status: Runtime Error

Solution code:
A,B,C,D= map(int, input().split())
L=A+B
R=C+D
if L>R:
  print('Left')
elif L=R:
  print('Balanced')
else :
  print('Right')

Submission status: Runtime Error

Solution code:
A= int(input())
B = int(input())
C = int(input())
D= int(input())
L=A+B
R=C+D
if L>R:
  print('Left')
elif L=R:
  print('Balanced')
else :
  print('Right')

Submission status: Runtime Error

Solution code:
 a, b, c ,d = map(int,input().split(' '))
L=a+b;R=c+d:
if L>R:
	print('Left')
elif L<R:
	print('Right')
else:
	print('Balanced')

Submission status: Runtime Error

Solution code:
 a, b, c ,d = map(int,input().split(' '))
L=a+b;R=c+d:
if L>R:
	print('Left')
elif L=R:
	print('Balance')
else:
	print('Right')

Submission status: Runtime Error

Solution code:
 a, b, c ,d = map(int,input().split(' '))
 L=a+b;R=c+d:
if L>R:
	print('Left')
elif L=R:
	print('Balance')
else:
	print('Right')

Submission status: Runtime Error

Solution code:
 a, b, c ,d = map(int,input().split(' '))
 L=a+b;R=c+d;
if L>R;
	print('Left')
elif L=R;
	print('Balance')
else;
	print('Right')

Submission status: Runtime Error

Solution code:
n, a, b = map(int, input().split())
count = 0

for i in range(n):
  check = (i+1)//10000 + (i+1)//1000 + (i+1)//100 + (i+1)//10 + (i+1)%10
  if check >= a:
    if check <= b:
      count += (i+1)
      
print(count)

Submission status: Runtime Error

Solution code:
s=input().replace(" ","+")
l,r=eval(s[:3]),eval(s[4:])
print("RLiegfhtt"[l>r::2] if l!=r else "Balanced")

Submission status: Runtime Error

Solution code:
A, B, C, D = map(int, input().split())
L = A + B
R = C + D
if L > R:
  print("Left")
elif L = R:
  print("Left")
else:
  print("Left")

Submission status: Runtime Error

Solution code:
L, R = map(int, input().split())
if L < R:
    print('Right')
elif L == R:
    print('Balanced')
else:
    print('Left')

Submission status: Runtime Error

Solution code:
A, B, C, D = map(int, input().split())
print('Left' if (A + B) > C + D else 'Balanced' if (A + B) = (C + D) else 'Right')

Submission status: Runtime Error

Solution code:
A, B, C, D = map(int, input().split())
print('Left' if A + B > C + D else 'Balanced' if A + B = C + D else 'Right')

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int,input().split())
print("Left" if a+b>c+d else "Right" if a+b<c+d else "Balanced
")

Submission status: Runtime Error

Solution code:
a, b, c, d = list(map(int, input().split()))

A = a + b
B = c + d
if A == B:
  print('Balanced')
else if A > B:
  print('Left')
else if A < B:
  print('Right')

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split())

count = 0   
for i in range(1,N+1):
    if A <= dsum(i) <= B:
        count += i

#各桁の合計を求める
def dsum(n): 
    s = str(n)
    array = list(map(int, s))
    return sum(array)

print(count)

Submission status: Runtime Error

Solution code:
n, a, b = map(int, input().split())
ans = 0
for i in range(n + 1):
    s = str(i)
    i_list = list(map(int, s))
    if sum(i_list) >= a and sum(i_list) <= b:
        ans += i
print(ans)

Submission status: Runtime Error

Solution code:
t = [int(v) for v in input().split(' ')]
n = t[0] + t[1]
n2 = t[2] + t[3]

if n > n2:
  print(n)
elif n < n2:
  print()n2

Submission status: Runtime Error

Solution code:
A, B, C, D = map(int, input())
if A+B>C+D:
  print('Left')
elif A+B<C+D:
  print('Right')
else:
  print('Balanced')

Submission status: Runtime Error

Solution code:
n, a, b = map(int, input().split())

total = 0
for i in range(n+1):
    wa = sum((map(int, str(i))))
    if a <= wa and wa <= b:
        total += i
print(total)

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split())

Num = 0
for i in range(N+1):
    list = [int(a) for a in list(str(i))]
    if sum(list) >= A and sum(list) <= B:
        Num += 1

print(Num)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
total=0
for i in range(1,N+1):
  s=str(i)
  if A<=sum(list(map(int,s)))<=B: total+=i
print(total)