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:
n, a, b = map(int,input().split())
res = 0
def s(n):
  n = str(n)
  arr = map(int, list(n))
  return sum(arr)

for i in range(1, n+1):
  v = s(i)
  if v >= a and v <= b:
    res = res + i
  else:
    pass

print(res)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
#n1=N//10
#n2=N%10
#n=n1+n2
ans=0
for i in range(N+1):
    if i>=100:
        i1=i//100
       # i2=(i-100)//10
        i3=i%10
        j=i1+i3
        if j>=A and j<=B:
            ans+=j
    else:
        i1=i//10
        i2=i%10
        j=i1+i2
        if j>=A and j<=B:
            ans+=0
print(ans)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
#n1=N//10
#n2=N%10
#n=n1+n2
n=0
for i in range(N+1):
    if i>=100:
        i1=i//100
        i2=(i-100)//10
        i3=i%10
        j=i1+i2+i3
        if j>=A and j<=B:
            n+=1
    else:
        i1=i//10
        i2=i%10
        j=i1+i2
        if j>=A and j<=B:
            n+=1
print(n)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
#n1=N//10
#n2=N%10
#n=n1+n2
n=0
for i in range(N+1):
    if N >=100:
        i1=i//100
        i2=(i-100)//10
        i3=i%10
        j=i1+i2+i3
         if j>=A and j<=B:
        n+=1
    else:
        i1=i//10
        i2=i%10
        j=i1+i2
        if j>=A and j<=B:
            n+=1
print(n)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
#n1=N//10
#n2=N%10
#n=n1+n2
n=0
for i in range(N+1):
    i1=i//10
    i2=i%10
    j=i1+i2
    if j>=A and j<=B:
        n+=0

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#1以上N以下の整数のうち、10進法で各桁の和がA以上B以下であるものについて総和
  
n=int(input())
a=int(input())
b=int(input())

def s(x):
        return x//10000 + x%10000//1000 + x%1000//100 + x%100//10 + x%10

sum=0

for i in range(n+1):
        if a<=int(s(i))<=b:
                sum+=i

print(sum)

Submission status: Runtime Error

Solution code:
N, A, B = [int(s) for s in input().split()]
r = 0;
def sumdig(n):
    r = 0;
    d = n % 10;
    r += d;
    n = (n - d) / 10;
    d = n % 10;
    r += d;
    n = (n - d) / 10;
    d = n % 10;
    r += d;
    n = (n - d) / 10;
    d = n % 10;
    r += d;
    n = (n - d) / 10;
    return r;
for n in range(1, N + 1):
    s = sumdig(n)
    if (s >= A and s <= B):
        r += n;
print(r)

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')

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')

Submission status: Runtime Error

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

for i in range(1,n+1):
  sum = 0
  j=0
  while True:
    num = i/(10**j)%10
    if num != 0:
      sum += num
      j+=1
    else:
      break
  if a<=sum and sum<=b:
    res += sum;

print(res)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

#import sys
#sys.setrecursionlimit(10000000)

def findSumOfDigits(n):
    sum = 0
    while n > 0.1:
        sum = sum + (n % 10)
        #print(n % 10)
        n = n - (n % 10)
        n = n / 10
    return sum

# 整数の入力
n = input()
n = int(n)

a = input()
a = int(a)

b = input()
b = int(b)

ans = 0

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

print(ans)

Submission status: Runtime Error

Solution code:
def findSumOfDigits(n):
    sum = 0
    while n > 0.1:
        sum = sum + (n % 10)
        #print(n % 10)
        n = n - (n % 10)
        n = n / 10
    return sum

# 整数の入力
n = input()
n = int(n)

a = input()
a = int(a)

b = input()
b = int(b)

ans = 0

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

print(int(ans))

Submission status: Runtime Error

Solution code:

import sys
sys.setrecursionlimit(10000000)

def findSumOfDigits(n):
    sum = 0
    while n > 0.1:
        sum = sum + (n % 10)
        #print(n % 10)
        n = n - (n % 10)
        n = n / 10
    return sum

# 整数の入力
n = input()
n = int(n)

a = input()
a = int(a)

b = input()
b = int(b)

ans = 0

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

print(int(ans))

Submission status: Runtime Error

Solution code:

#import sys
#sys.setrecursionlimit(1000000)

def findSumOfDigits(n):
    sum = 0
    while n > 0.1:
        sum = sum + (n % 10)
        #print(n % 10)
        n = n - (n % 10)
        n = n / 10
    return sum

# 整数の入力
n = input()
n = int(n)

a = input()
a = int(a)

b = input()
b = int(b)

ans = 0

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

print(int(ans))

Submission status: Runtime Error

Solution code:

import sys
sys.setrecursionlimit(1000000) 

def findSumOfDigits(n):
    sum = 0
    while n > 0.1:
        sum = sum + (n % 10)
        #print(n % 10)
        n = n - (n % 10)
        n = n / 10
    return sum

# 整数の入力
n = input()
n = int(n)

a = input()
a = int(a)

b = input()
b = int(b)

ans = 0

for i in range(1,n+1):
    #print(i)
    test = findSumOfDigits(i)
    if a <= test:
        if b >= test:
            ans = ans + i

print(int(ans))

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

print(ans)

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 = 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:
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:
n, a, b = map(int, input().split())
ans = 0
for i in range(1,n + 1):
    if a <= sum([int(j) for j in str(i)]) <=b:
        ans +=i
print(ans)

Submission status: Runtime Error

Solution code:
A = [map(int, 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: 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")
if a+b=c+d:
  print("Balanced")
else:
  print("Right")

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())

ans = 0

for x in range(N+1):
    sum = 0
    xx = x
    while xx != 0:
        sum += xx % 10
        xx = xx / 10

    if A <= sum and B >= sum:
        ans += x

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:
n, a, b = map(int, input().split())
counter = 0

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

print(counter)

Submission status: Runtime Error

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

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

print(counter)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
W = map(int,input().split())
if sum(W[:2]) < sum(W[2:]):
  print("Right")
elif sum(W[:2]) > sum(W[2:]):
  print("Left")
else:
  print("Balanced")

Submission status: Runtime Error

Solution code:
for i in range(4)
a[i] = input()

Submission status: Runtime Error

Solution code:
def digits(x):
    ans = 0
    for i in range(4,-1,-1):
        ans += x//(10**i)
        x = x - ((10**i)*(x//(10**i)))
    return ans

[N,A,B] = list(map(int,input().split()))
data = []
for i in range(1,N+1):
    if A <= digits(i) <= B:
        data.append(i)

print(sum(data))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a

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, sum(str(i)))))<=b:
        ans += i
print(ans)

Submission status: Runtime Error

Solution code:
s=sum(map(int,input().split()));
sl=sum(map(int,input().split()[:2]))
if sl>s/2:
  m='Left'
elif sl==s/2:
  m='Balanced'
else:
  m='Right'
print(m)

Submission status: Runtime Error

Solution code:
l=map(int,input().split())
L=l[0]+l[1]
R=l[2]+l[3]

if R==L:
  print('Balanced')
elif R>L:
  print('Right')
else:
  print('Left')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
a, b = map(int, input().split())
print(max(1+int(math.log2(b//a)), 0))

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())
count = 0
for i in range(n+1):
    if i == 10000 and a == 1:
        count += 1
        break
    judge = i%10 + (i%100 - i%10)//10 + (i%1000 - i%100)//100 + (i%10000 - i%1000)//1000
    if judge >= a and judge <= b:
        count += i
print(count)

Submission status: Runtime Error

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

cursum = 0

for x in range(1, n+1):
    y = sum(map(int, str(x)))
    if a <= sum and sum <= b:
        cursum += x

print(cursum)

Submission status: Runtime Error

Solution code:
l = list(map(int, input().split()))

cursum = 0

for n in range(1, l[0]+1):
    x = sum(map(int, str(n)))
    if a <= x and x <= b:
        cursum += n

print(cursum)

Submission status: Runtime Error

Solution code:
l = list(map(int, input().split()))

cursum = 0

for n in range(1, l[0]+1):
    x = sum(list(map(int, str(n))))
    if a <= x and x <= b:
        cursum += n

print(cursum)

Submission status: Runtime Error

Solution code:
l = list(map(int, input().split()))

cursum = 0

for n in range(1, l[0]+1):
    x = sum(list(map(int, list(n))))
    if a <= x and x <= b:
        cursum += n

print(cursum)

Submission status: Runtime Error

Solution code:
l = list(map(int, input().split()))

cursum = 0

for n in range(1, l[0]+1):

    if a <= sum(list(map(int, list(n)))) <= b:
        cursum += n

print(cursum)

Submission status: Runtime Error

Solution code:
n,a,b =  map(int,input().split())
ans = 0
for i in range(n+1):
        good_num = 0
        for j in str(i) :
                good_num += int(j)
        if a <= good_num <= 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('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());print('Left' if a+b>c+d elif a+b<c+d 'Right' else 'Balanced')

Submission status: Runtime Error

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

#該当する数を代入していく
sum = 0

#各桁の和をいれる
tmp_sum = 0

for i in range(1, n+1):
    tmp_sum = 0
    tmp = i

    for j in range(4):
        tmp_sum += tmp % 10
        tmp = tmp // 10

    if( (tmp_sum>=a) and (tmp_sum<=b) ):
        sum += i

print(sum)

Submission status: Runtime Error

Solution code:
n,a,b = 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:
if __name__ == '__main__':
    n, a, b = map(int, input().split())

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

    print(count)

Submission status: Runtime Error

Solution code:
n,a,b = list(map(int,input().split()))
num_sum = 0
for ni in range(n+1):
    d1 = ni%10
    d2 = (ni//10)%10
    d3 = (ni//100)%10
    d4 = (ni//1000)%10
    d5 = (ni//10000)%10
    digit_sum = d1 + d2 + d3 + d4 + d5
    if digit_sum >= a and digit_sum <= b: num_sum += ni
print(num_sum)

Submission status: Runtime Error

Solution code:
n=map(int,int(input().split(" ")))
if n[0]+n[1]>n[2]+n[3]:
  print("Left")
elif n[0]+n[1]==n[2]+n[3]:
  print("Balaced")
else:
  print("Right")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=map(int,int(input().split(" ")))
if n[0]+n[1]>n[2]+n[3]:
  print("Left")
else if n[0]+n[1]==n[2]+n[3]:
  print("Balaced")
else:
  print("Right")

Submission status: Runtime Error

Solution code:
n=map(int,int(input().split(" ")))
if n[0]+n[1]>n[2]+n[3]:
  print("Left")
elseif n[0]+n[1]==n[2]+n[3]:
  print("Balaced")
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("Blanced")
else:
  print("Right")

Submission status: Runtime Error

Solution code:
1 7 6 4

Submission status: Runtime Error

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

ans = 0

for i in range(1, n + 1):
    num = i
    total = 0
    while num != 0:
        total += num % 10
        num //= 10

    if a <= total <= b:
        ans += i

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
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 =input().split()
for i in range(4): x[i] = int(x[i])
e =a+b
f =c+d
if e > f:
  print("Left")
elif e<f:
  print("Right")
else : print("Balanced")

Submission status: Runtime Error

Solution code:
A,B,C,D=map(int,input().split())
print([Balanced,Left,Right][(C+D<A+B)-(C+D>A+B)])

Submission status: Runtime Error

Solution code:
A, B, C, D = map( int, input().split())
L = A + B
R = C + D
print(["Balance","Left","Right"][R<L - R>L]

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:
  print('Left')

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('Balanced')
else:
    print('Right')

Submission status: Runtime Error

Solution code:
#include <cstdio>
#include <vector>
#include <iostream>
using namespace std;

int main(){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    if(a+b < c+d){
        cout << "Right" << endl;
        return 0;
    }
    else if( a+b > c+d){
        cout << "Left" << endl;
        return 0;
    }
    else{
        cout << "Balanced" << endl;
    }
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Nov  4 21:46:51 2018

@author: sk
"""


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

s1=a+b
s2=c+d

if s1>s2:
  print("Left")
elseif s1==s2:
  print("Balanced")
else:
  print("Right")

Submission status: Runtime Error

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

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


n = int(input())
a = int(input())
b = int(input())
total = 0
    
for i in range(1, n+1):
    sum = sumDigit(i)
    if(a<= sumDigit(i) <=b):
        total += i

print(total)

Submission status: Runtime Error

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

ab = A + B
cd = C + D

if ab == cd:
    print('Balanced')
elif ab > cd:
    print('Left')
else:
    print('Right')

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=550000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=575000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

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")
if a+b==c+d:
    print("Balanced")
else:
    print("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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

arr = []
ans = 0

for i in range(N):
     y = i
     while y >= 1:
         arr.append(int(i % 10))
         i = int(i/10)
    if sum(arr)>= A and sum(arr) <= B:
        ans += sum(arr)
        arr = []
    else:
        arr = []
        
ptint(ans)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;

int main(){
	int M;
	cin>>M;
	cout<<48-M<<endl;
}

Submission status: Runtime Error

Solution code:
A, B, C, D = map(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:
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:
  ptint("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:
  ptinr("Right")

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())

i = 0
for k in range(N +1):
    if A <= sum( [int(s) for s in str(k)] ) <= B:
        i = i+1
print(i)

Submission status: Runtime Error

Solution code:
Weiht = list(map(int, input().split()))
if (Weight[0] + Weight[1]) > (Weight[2] + Weight[3]):
    print("Left")
elif (Weight[0] + Weight[1]) < (Weight[2] + Weight[3]):
    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:
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())
lw = A+B 
rw = C+D 
if lw > rw:
    print(Left)
elif lw < rw:
    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 A+B <=C+D:
    print('Right')

Submission status: Runtime Error

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

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

for i in range(1,N+1): 
  # set condition for i < 10^4
  if i < 10:
	digitsum = i
  elif i<100:
    digitsum = i//10+i%10
  elif i<1000:
    digitsum = i//100+(i%100)//10+(i%100)%10
  elif i<10000:
    digitsum= i//1000+(i%1000)//100+((i%1000)%100)//10+((i%1000)%100)%10
  else:
    digitsum = 1
 
  if A <= digitsum and digitsum <= B:
  	output = output+ i
    
print (output)

Submission status: Runtime Error

Solution code:
N,A,B = map(int,input().split())
output = 0
for i in range(1,N+1): 
  # set condition for i < 10^4
  if i < 10:
	digitsum = i
  elif i<100:
    digitsum = i//10+i%10
  elif i<1000:
    digitsum = i//100+(i%100)//10+(i%100)%10
  elif i<10000:
    digitsum= i//1000+(i%1000)//100+((i%1000)%100)//10+((i%1000)%100)%10
  else:
    digitsum = 0
 
  if A <= digitsum and digitsum <= B:
  	output += i
    
print (output)
N,A,B = map(int,input().split())
output = 0
for i in range(1,N+1): 
  # set condition for i < 10^4
  if i < 10:
	digitsum = i
  elif i<100:
    digitsum = i//10+i%10
  elif i<1000:
    digitsum = i//100+(i%100)//10+(i%100)%10
  elif i<10000:
    digitsum= i//1000+(i%1000)//100+((i%1000)%100)//10+((i%1000)%100)%10
  else:
    digitsum = 1
 
  if A <= digitsum and digitsum <= B:
  	output += i
    
print (output)
N,A,B = map(int,input().split())
output = 0
for i in range(1,N+1): 
  # set condition for i < 10^4
  if i < 10:
	digitsum = i
  elif i<100:
    digitsum = i//10+i%10
  elif i<1000:
    digitsum = i//100+(i%100)//10+(i%100)%10
  elif i<10000:
    digitsum= i//1000+(i%1000)//100+((i%1000)%100)//10+((i%1000)%100)%10
  else:
    digitsum = 0
 
  if A <= digitsum and digitsum <= B:
  	output += i
    
print (output)
N,A,B = map(int,input().split())
output = 0
for i in range(1,N+1): 
  # set condition for i < 10^4
  if i < 10:
	digitsum = i
  elif i<100:
    digitsum = i//10+i%10
  elif i<1000:
    digitsum = i//100+(i%100)//10+(i%100)%10
  elif i<10000:
    digitsum= i//1000+(i%1000)//100+((i%1000)%100)//10+((i%1000)%100)%10
  else:
    digitsum = 1
 
  if A <= digitsum and digitsum <= B:
  	output = output + i
    
print (output)

Submission status: Runtime Error

Solution code:
N,A,B = map(int,input().split())
output = 0
for i in range(1,N+1): 
  # set condition for i < 10^4
  if i < 10:
	digitsum = i
  elif i<100:
    digitsum = i//10+i%10
  elif i<1000:
    digitsum = i//100+(i%100)//10+(i%100)%10
  elif i<10000:
    digitsum= i//1000+(i%1000)//100+((i%1000)%100)//10+((i%1000)%100)%10
  else:
    digitsum = 1
 
  if A <= digitsum and digitsum <= B:
  	output += i
    
print (output)

Submission status: Runtime Error

Solution code:
N,A,B = map(int,input().split())
output = 0
for i in range(1,N+1): 
  # set condition for i < 10^4
  if i < 10:
	digitsum = i
  elif i<100:
    digitsum = i//10+i%10
  elif i<1000:
    digitsum = i//100+(i%100)//10+(i%100)%10
  elif i<10000:
    digitsum= i//1000+(i%1000)//100+((i%1000)%100)//10+((i%1000)%100)%10
  else:
    digitsum = 0
 
  if A <= digitsum and digitsum <= B:
  	output += i
    
print (output)

Submission status: Runtime Error

Solution code:
N,A,B = map(int,input().split())
output = 0
for i in range(1,N+1): 
  # set condition for i < 10^4
  if i < 10:
	digitsum = i//10 + i%10
  elif i<100:
    digitsum = i//10+i%10
  elif i<1000:
    digitsum = i//100+(i%100)//10+(i%100)%10
  elif i<10000:
    digitsum= i//1000+(i%1000)//100+((i%1000)%100)//10+((i%1000)%100)%10
  else:
    digitsum = 0

  if A <= digitsum and digitsum <= B:
  	output += i
    
print (output)

Submission status: Runtime Error

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

output = 0

for i in range(1,N+1): 
  # set condition for i < 10^4
  if i < 10:
	digitsum = i//10 + i%10
  elif i<100:
    digitsum = i//10+i%10
  elif i<1000:
    digitsum = i//100+(i%100)//10+(i%100)%10
  elif i<10000:
    digitsum= i//1000+(i%1000)//100+((i%1000)%100)//10+((i%1000)%100)%10
  else:
    digitsum = 0

  if A <= digitsum and digitsum <= B:
  	output += i
    
print (output)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
l, r = int(input()) + int(input()), int(input()) + int(input())
if l > r:
  print('Left')
elif r < l:
  print('Right')
else:
  print('Balanced')

Submission status: Runtime Error

Solution code:
n,a,b=list(map(int,input().split()))
sum([i for i in range(1,n+1) if a<=sum([int(c) for c in 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:
    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')
elsif l = r:
  print('Balanced')
else:
  print('Right')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

if l > r:
  print('left')
elsif l = r:
  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:
import std.stdio, std.string, std.conv;
 void main(){
   auto ip = readln.split.to!(int[]);
   if(ip[0] + ip[1] > ip[2] + ip[3]){
     writeln("Left");
   }else if(ip[0] + ip[1] < ip[2] + ip[3]){
     writeln("Right");
   }else{
     writeln("Balanced");
   }
 }

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
print((a+b+1)//2)

Submission status: Runtime Error

Solution code:
n, a, b = map(int, input().split())
total = 0
for x in range(n+1):
    X = [int(x) for x in list(str(x))]
    sum_x = sum(X)
    if a <= sum_x <= b:
        total += x
print(total)

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:

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

n,a,b = map(int,input().split(" "))
print(n)
total = 0
for i in range(n + 1):
    print (i)
    ans = find_sum_digits(i)
    if a <= ans <= b:
        total += i
print(total)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
X,Y=map(int,input().split())
dev = int(Y/X)
work = 1
for i in range(74):
  tmp = pow(2,i)
  if tmp <= dev and dev < tmp*2:
    work +=i
    break
print(work)