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: Runtime Error

Solution code:
X,Y = map(int,input().split())
ans = 0
while Y>=X:
    ans += 1
    X*=2
print(ans)

Submission status: Runtime Error

Solution code:
X,Y = map(int,input().split())
A = []

for i in range(1,Y - X):
    if X * 2 **(i - 1) >= Y:
        break
    else:
        A.append(X * (2 ** (i - 1)))
print(len(A))

Submission status: Runtime Error

Solution code:
N,a,b = list(int(x) for x in input().split())
ans = 0
for i in range(N+1):
  m = int(i/1000)
  n = int((i%1000)/100)
  j = int((i%100)/10)
  k = i%10
  sum = m + n + j + k 
  if sum >= a and sum <= b:
    ans = 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):
    array = list(str(i))
    s = 0
    for j in array:
        s = int(j) + s
    if s >= a and s <= b:
        count = count + i

print(count)

Submission status: Runtime Error

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

sum_number = []

for i in range(x+1):
  if a <= sum(map(int, str(i))) <= b:
    sum_number += [i]
    
priny(sum(sum_number))

Submission status: Runtime Error

Solution code:
def somesum(n):
    sum = 0
    x = n
    while int(x / 10) > 0:
        sum += x % 10
        x = int(x / 10)
    sum += x % 10
    return sum
    
n,a,b = map(int,input().split())
sum = 0
for val in range(1,n+1):
    if somesum(val) >= a and somesum(val) <= b:
        sum += val
print(sum)

Submission status: Runtime Error

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"
elif a+b=c+d:
  print "Balanced"

Submission status: Runtime Error

Solution code:
n,a,b=mao(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())
ret = 0
for i in range(N+1):
  s = sum([int(c) for c in str(i)])
  print(s,i)
  if A <= s and s <= B:
    ret += i
print(ret)

Submission status: Runtime Error

Solution code:
N,A,B = map(int, input().split())
ret = 0
for i in range(N):
  s = sum([int(c) for c in str(i)])
  if A <= s and s <= B:
    ret += i
print(ret)

Submission status: Runtime Error

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

print(sum(i in i range(1,N+1) if A<=sum(map(int,str(i)))<=B))

Submission status: Runtime Error

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

print(sum(i in i range(1,N+1)
         if A<=sum(map(int,str(i))<=B))

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("Left")
else:
	print("Balanced")

hibiki@

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:
N, A, B = map(int, input().split())
res = 0
for i in range(N+1):
    if A <= sum([int(s) for s in str(i)]) <= B:
        res += i
print(res)

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:
l =map(int,input().split());a=sum(l[:2])-sum(l[3:]);print('Left') if a>0 else print('Right')if a<0 else print('Balanced')

Submission status: Runtime Error

Solution code:
# 関数を使った場合
N, A, B = map(int, input().split())
ans = 0

def FindSumOfDigits(x):
    count = 0
    while x>0:
        count += x%10
        x = x//10
    
    return count
    

for n in range(1, N+1):
    count = FindSumOfDigits(n)
    if A<= count <=B:
        ans += n

print(ans)

Submission status: Runtime Error

Solution code:
# 関数を使った場合
N, A, B = map(int, input().split())
l = []
ans = 0

def FindSumOfDigits(x):
    count = 0
    while x>0:
        count += x%10
        x = x//10
    
    return count
    

for n in range(1, N+1):
    count = FindSumOfDigits(n)
    if A<= count <=B:
        ans += n

print(ans)

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int,input().split())
print("Left" if a+b > c+d elif a+b == c+d "Balanced" else "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("Right")
else if l==r:
  print("Blanceed")
else:
  print("Left")

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().spilit())
l=a+b
r=c+d
if l < r:
  print("Right")
else:
  print("Left")

Submission status: Runtime Error

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

sum = 0

for i in range(N):
    sum_t = 0
    j = i + 1
    n = j
    while n != 0:
        sum_t += n % 10
        n //= 10
    if sum_t >= A and sum_t <= B:
        sum += j

print(sum)

Submission status: Runtime Error

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

for i in range(N+1):
    T = (i//10000) + ((i//1000)%10) + ((i//100)%10) + ((i//10)%10) + (i%10)
    if (A<=T) and (T<=B):
        L += i

print(L)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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:
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(1, n+1):
    sum = 0
    x = i
    while x > 0:
        sum += x % 10
        x = x//10
    if sum >= a and sum <= 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:
def sm(x):
    a = 0
    a += (x%10)
    a += (x//10)%10
    a += ((x//10)//10)%10
    a += (((x//10)//10)//10)%10
    a += ((((x//10)//10)//10)//10)%10
    return a
 
N, A, B = map(int,input().split())
ans = 0
for i in range(1, N+1):
    if A <= sm(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(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(i))))) <= 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:
x,y=map(int,input().split())
for i in range(1,1000):
  x*=2
  if x>y:
    print(i)
    break

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("Right")
elif A + B == C + D:
    print("Balanced"

Submission status: Runtime Error

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

def findsum(n):
    sum = 0
    while n>0:
        sum += n%10
        n //= 10
    return sum

mylist = [i for i in range(n+1) if a<=findsum(i) and findsum(i)<=b]
print(sum(mylist))

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int,input().split())
if a + b > c + d:
  prtin("Left")

elif a + b < c + d:
  print("Right")

else:
  print("Balanced")

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int,input().split())
if a + b > c + d:
  prtin("Left")

elif a + b < c + d:
  print("Right")

else:
  print("Balansed")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
line = input()
left, right = eval(line[:3].replace(" ", "+")), eval(line[-4:].replace(" ", "+"))
print((
    "Left" if left > right else
    "Balanced" if left == right else
    "Right"
    ))

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

Solution code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))

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

m = a +b -c-d

if m>0:
    print("Left")
elif m =0:
    print("Balanced")
else:
    print("Right")

Submission status: Runtime Error

Solution code:
n,a,b = [int(input()) for i in range(3)]
t=0
for i in range(1,n+1):
    orign=i
    total = 0
    for ii in range(len(str(i))):
        total += i%10
        i=int(i/10)
    if total>=a and total<=b:
        t+=orign
print(t)

Submission status: Runtime Error

Solution code:
N, A, B = (int(i) for i in input().split()) 

if (N < 1 or 10**4 < N):
    sys.exit(100)
elif A > B:
    sys.exit(100)
elif A < 1:
    sys.exit(100)
elif 36 < B:
    sys.exit(100)

ans = 0
for n in range(1, N+1):
    tmp_sum = 0
    tmp_n = n
    while tmp_n != 0:
        tmp_sum += tmp_n % 10
        tmp_n = tmp_n // 10
    if (A <= tmp_sum and tmp_sum <= B):
        ans += n
print(ans)

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
if a+b > c+d:
    pirnt('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:
    pirnt('Left')
elif a+b == c+d :
    print('Balanced')
elif a+b < c+d :
    print('Right')

Submission status: Runtime Error

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

num = 0
for i in range(1,N+1):
    lst = list(str(i))
    s = sum(list(map(int,lst)))
    if A <= s <= B:
        num += i
print(num)

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")
wlaw:
  print("Balanced")

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:
abcd=int(input().split())
a=abcd[0]
b=abcd[1]
c=abcd[2]
d=abcd[3]
if a+b==c+d:
  print('Balanced')
else:
    if a+b>c+d:
      print('Left')
    else:
        print('Right')

Submission status: Runtime Error

Solution code:
abcd=int(input().split())
a=abcd[0]
b=abcd[1]
c=abcd[2]
d=abcd[3]
if a+b==c+d:
  print('Balanced')
  else:
    if a+b>c+d:
      print('Left')
      else:
        print('Right')

Submission status: Runtime Error

Solution code:
abcd=int(input().split())
a=abcd[0]
b=abcd[1]
c=abcd[2]
d=abcd[3]
if a+b=c+d:
  print('Balanced')
  else:
    if a+b>c+d:
      print('Left')
      else:
        print('Right')

Submission status: Runtime Error

Solution code:
abcd=int(input().split())
a=abcd[0]
b=abcd[1]
c=abcd[2]
d=abcd[3]
if a+b=c+d:
  print('balanced')
  else:
    if a+b>c+d:
      print('Left')
      else:
        print('Right')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#input
#A = int(input())
#B = int(input())
#C = int(input())
#X = int(input())
#A = list(map(int,input().split()))
#b = int(input())
N,A,B = map(int,input().split())

#s = [0,0,0]
#s[0] = int(input/100)
#s[1] = int(input/10 - s[0]*10)
#[2] = int(input%10)



sum = 0
temp=0
tempy=0
#flag = 0

for i in range(1, N+1): #loop for N
  
  result = 0
  temp = i
  
  while(1):
    result += (int)(temp%10)
    tempy = (int)(temp/10)
    if tempy==0:
      break
    else:
      temp = tempy
  
  if (result >= A) and (result <= B):
    sum += i
    #print(i)
  
  #####
  #revB
  #####
  #p = i%10 #1桁目
  #tempy = (int)(i/10)
  #
  #if tempy > 0:
  #  q = tempy%10 #2桁目
  #  temp = (int)(tempy/10)
  #  tempy = temp
  #else:
  #  q=0
  #  r=0
  #  s=0
 # 
  #if tempy > 0:
  #  r = tempy%10 #3桁目
  # temp = (int)(tempy/10)
  #  tempy = temp
  #else:
  #  r=0
  #  s=0
  
  #if tempy > 0:
  #  s = tempy%10 #4桁目
  #else:
  #  s=0
  
  #####
  #revA
  #####
  #s = (int)(i/1000)
  #r = (int)(i/100-10*s)
  #q = (int)(i/10-10*r-100*s)
  #p = (int)(i%10)
  #print(p)
  #print(q)
  #print(r)
  #print(s)
  
  #temp = p+q+r+s
  #if (temp >= A) and (temp <= B):
  #  sum += i
  #  print(i)

  
#judge

#print('result')
#print(A)
print(sum)

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 L < R:
    print('Right')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
weight = input().split(" ")
if weight[0] + weight[1] > weight[2] + weight[3]:
  print("Left")
elif weight[0] + weight[1] = weight[2] + weight[3]:
  print("Balanced")
else:
  print("Right")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int, input().split())
print('Balanced' if  a+b==c+d '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 'Left' a+b>c+d else 'Right')

Submission status: Runtime Error

Solution code:
# ABC083 C - Multiple Gift
x,y = map(int,input().split())

ans = 0
while x <= y:
    x *= 2
    ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
print(48-int(input()))

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int,input())
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())
if a+b>c+d:
  print('Left')
elif a+b=c+d:
  print('Balanced')
else:
  print('Right')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b,c,d=map(int,input().split())

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

Submission status: Runtime Error

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b,c,d=input().split()

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

Submission status: Runtime Error

Solution code:
import math

if __name__ == '__main__':
    X, Y = map(int, input().split())
    # print(int(math.log2(Y//X)+1))
    print(len(bin(Y//X))-2)
    # ans = 0
    # while X <= Y:
    #     ans += 1
    #     X *= 2
    # print(ans)

Submission status: Runtime Error

Solution code:
import math

if __name__ == '__main__':
    X, Y = map(int, input().split())
    # print(int(math.log2(Y//X)+1))
    ans = 0
    while X <= Y:
        ans += 1
        X *= 2
    print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

l = A + B
r = C + D

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

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(map(int, str(i))) <= 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())
A = ["Left", "Balanced", "Right"]
print(A[(c+d) // (a+b) - (a+b) // (c+d) + 1])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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('Left')
if (a+b) == (c,d):
    print('Balanced')
if (a+b) < (c,d):
    print('Right')

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(list(map(int, list(str(i)))))<=B:
        ans+=i
print(ans)

Submission status: Runtime Error

Solution code:
n,a,b=map(int,input().split())
 
def find_sum_of_digits(n):
    sum = 0
    int(n)
    while n > 0:
        sum += n % 10
        n //= 10
    return sum
 
total = 0
for i in range(1, n+1):
    sum_of_digits_tmp = find_sum_of_digits(i)
    if a <= sum_of_digits_tmp and sum_of_digits_tmp <= b:
        total += i
 
print(total)

Submission status: Runtime Error

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

def find_sum_of_digits(n):
    sum = 0
    int(n)
    while n > 0:
        sum += n % 10
        n //= 10
    return sum

total = 0
for i in range(1, n+1):
    sum_of_digits_tmp = find_sum_of_digits(i)
    print(sum_of_digits_tmp)
    if a <= sum_of_digits_tmp and sum_of_digits_tmp <= b:
        total += i

print(total)

Submission status: Runtime Error

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

counter = 0

for i in range(1,n+1):
  thou = i // 1000
  hund = (i - thou * 1000) // 100
  ten  = (i - thou * 1000 - hund * 100) // 10
  one  =  i - thou * 1000 - hund * 100 - ten * 10
  sum_all = thou + hund + ten + one
  if sum_all >= a and sum_all <= b:
    counter += i

print(counter)

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 = 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:
# -*- coding: utf-8 -*-

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

s = 0

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

Submission status: Runtime Error

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

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

s = 0

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

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:
  pritn('Right')

Submission status: Runtime Error

Solution code:
def find_sum(n):
  ret = 0
  while(n > 0):
    ret += int(n % 10)
    n = int((n - n % 10) / 10)
  return ret

N, A, B = map(int, input().split())
ret = 0
for i in range(N + 1):
  #v = sum(map(int, list(str(i))))
  v = find_sum(i)
  if v >= A and v <= B:
    ret += i
print(ret)

Submission status: Runtime Error

Solution code:
def find_sum(n):
  ret = 0
  while(n > 0):
    ret += n % 10
    n = (n - n % 10) / 10
  return ret

N, A, B = map(int, input().split())
ret = 0
for i in range(N + 1):
  #v = sum(map(int, list(str(i))))
  v = find_sum(i)
  if v >= A and v <= B:
    ret += i
print(ret)

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split())
sum = 0
 
for n in range(N+1):
  N1 = int(n/10000)
  N2 = int((n-10000*N1)/1000)
  N3 = int((n-10000*N1-1000*N2)/100)
  N4 = int((n-10000*N1-1000*N2-100*N3)/10)
  N5 = n-10000*N1-1000*N2-100*N3-10*N4
  if A <= N1+N2+N3+N4+N5 <= B:
    sum = sum + n
 
 
print(sum)

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split())
sum = 0
 
for n in range(N+1):
  N1 = int(n/10000)
  N2 = int((n-10000*N1)/1000)
  N3 = int((n-10000*N1-1000*N2)/100)
  N4 = int((n-10000*N1-1000*N2-100*N3)/10)
  N5 = n--10000*N1-1000*N2-100*N3-10*N4
  if A <= N1+N2+N3+N4+N5 <= B:
    sum = sum + n


print(sum)

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split())
sum = 0
 
for n in range(N+1):
  N1 = int(n/10000)
  N2 = int((n-10000*N1)/1000)
  N3 = int((n-10000*N1-1000*N2)/100)
  N4 = int((n-10000*N1-1000*N2-100*N3)/10)
  N5 = n--10000*N1-1000*N2-100*N3-10*N4
  if A <= N1+N2+N3+N4+N5 <= B:
    sum = sum + n

print(N1)

Submission status: Runtime Error

Solution code:
def sumall(a):
    n = 0
    while a > 0:
        n += a % 10 
        a = a // 10
    return n
 
 
n, a, b = map(int, input().split())
 
c = [0 for i in range(n)]
for i in range(n):
    c[i] = sumall(i+1)
    
d = 0
for i in range(n):

    if a <= c[i] <= b:
        d += i+1
        
print(d)

Submission status: Runtime Error

Solution code:
def sumall(a):
    n = 0
    while a > 0:
        n += a % 10 
        a = a // 10
    return n
 
 
n, a, b = map(int, input().split())
 
c = [0 for i in range(n)]
for i in range(n):
    c[i] = sumall(i+1)
    
d = 0

Submission status: Runtime Error

Solution code:
def sumall(a):
    n = 0
    while a > 0:
        n += a % 10 
        a = a // 10
    return n


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

c = [0 for i in range(n)]
for i in range(n):
    c[i] = sumall(i+1)
    
d = 0

for i in range(n):

    if a <= c[i] <= b:
        d += i+1
        
print(d)

Submission status: Runtime Error

Solution code:
i1 = input().split(' ')
a=int(i1[0])+int(i1[1])
b=int(i1[2])+int(i1[3])

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

Submission status: Runtime Error

Solution code:
weight = list(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:
import math
 
n, a, b = map(int, input().split())
 
sum_all = 0
for i in range(1, n + 1):
    sum_n = 0
    m = i
    while(m > 0):
        sum_n += math.floor(m % 10)
        m /= 10
    if a <= sum_n <= b:
        sum_all += i
 
print(sum_all)

Submission status: Runtime Error

Solution code:
import math

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

sum_all = 0
for i in range(1, n + 1):
    sum_n = 0
    m = i
    while(m > 0):
        sum_n += math.floor(m % 10)
        m = int(m / 10)
    if a <= sum_n <= b:
        sum_all += i

print(sum_all)

Submission status: Runtime Error

Solution code:
import math
x, y = map(int, input().split())
print(math.floor(math.log2(y//x))+1)

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('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")
elif L < R:
  print("Right")

Submission status: Runtime Error

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

def find_sum_of_digits(n):
  sum = 0
  while n >0:
    sum = sum + n%10
    n = round(n/10)
  return sum

total = 0
for number in range(1,N+1):
  all_sum = find_sum_of_digits(number)
  if A <= all_sum and all_sum <= B:
    total = total + number

print(total)

Submission status: Runtime Error

Solution code:
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            var a = cin.ReadInt;
            var b = cin.ReadInt;
            var c = cin.ReadInt;
            var d = cin.ReadInt;
            var x = a+b;
            var y = c+d;
            if(x==y){
                WriteLine("Balanced");
            }else if(x>y){
                WriteLine("Left");
            }else{
                WriteLine("Right");
            }
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator =' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); }}
        public int ReadInt { get { return int.Parse(Read); }}
        public long ReadLong { get { return long.Parse(Read); }}
        public double ReadDouble { get { return double.Parse(Read); }}
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret;}
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret;}
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret;}
    }
}

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input())
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:
aa = list(map(int,input().split()))
bb = ["Left","Right","Balanced"]
a,b,c,d = [i for i in aa]

print(bb[0] if a + b > c +d)
print(bb[1] if a + b < c +d)
print(bb[2] if a + b == c +d)

Submission status: Runtime Error

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

if res == 0:
  pritn("Balanced")
elif res > 0:
  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:
a, b, c, d = map(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())
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:
n, a, b = map(int, input().split())
ans = 0
 
for i in range(1, n+1):
    digits = map(int, list(str(i)))
    sums = sum(digits)
 
    if a <= sums and sums <= b:
        ans += i
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(1, n+1):
  tmp = map(int, list(str(i)))
  v = sum(tmp)
  if v >= a and v <= b:
    res += i

print(res)

Submission status: Runtime Error

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

for i in range(1, n+1):
  v = sum(map(int, list(str(i))))
  if v >= a and v <= b:
    res += i

print(res)

Submission status: Runtime Error

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

for i in range(1, n+1):
  v = sum(map(int, list(str(i))))
  if v >= a and v <= b:
    res = res + i
  else:
    pass

print(res)