#include <bits/stdc++.h>
using namespace std;
string to_small(string x) {
  for (long long i = 0; i < x.size(); i++) {
    if (x[i] >= 65 && x[i] <= 90) x[i] = x[i] - 'A' + 'a';
  }
  return x;
}
string to_capital(string x) {
  for (long long i = 0; i < x.size(); i++) {
    if (x[i] >= 97 && x[i] <= 122) x[i] = x[i] - 'a' + 'A';
  }
  return x;
}
long long fact(long long n) {
  long long f = 1;
  for (long long i = 1; i <= n; i++) f *= i;
  return f;
}
bool is_prime(long long n) {
  bool flag = true;
  if (n == 1)
    flag = false;
  else {
    long long c = 0;
    for (long long i = 2; i <= sqrt(n); i++) {
      if (n % i == 0) {
        c++;
        break;
      }
    }
    (c > 0) ? flag = false : flag = true;
    c = 0;
  }
  return flag;
}
long long gcd(long long x, long long y) {
  while (y != 0) {
    long long temp = y;
    y = x % y;
    x = temp;
  }
  if (x < 0) x *= -1;
  return x;
}
long long lcm(long long x, long long y) {
  long long a = x;
  long long b = y;
  while (y != 0) {
    long long temp = y;
    y = x % y;
    x = temp;
  }
  if (x < 0) x *= -1;
  a = a * b;
  if (a < 0) a *= -1;
  return (a / x);
}
long long arr[100000], n, s;
vector<long long> v;
long long f(long long mid) {
  for (long long j = 0; j < n; j++) {
    long long a = arr[j] + ((j + 1) * mid);
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  long long co = 0;
  for (long long i = 0; i < mid; i++) co += v[i];
  v.clear();
  return co;
}
const long long mod = 1e9 + 7;
long long power(long long base, long long ex) {
  long long ans = 1;
  base %= mod;
  while (ex > 0) {
    if (ex & 1) ans = (ans * base) % mod;
    ex >>= 1;
    base = (base * base) % mod;
  }
  return ans;
}
int main() {
  string x;
  cin >> x;
  long long sz = x.size();
  int j = 0;
  for (long long i = 0; i < sz; i++) {
    if (x[i] == '^') {
      j = i;
      break;
    }
  }
  int c = j;
  long long suml = 0, sumr = 0;
  for (long long i = 0; i < c; i++) {
    if (x[i] >= '1' && x[i] <= '9') {
      suml += (x[i] - '0') * j;
    }
    j--;
  }
  int s = 1;
  for (long long i = c + 1; i < sz; i++) {
    if (x[i] >= '1' && x[i] <= '9') {
      sumr += (x[i] - '0') * s;
    }
    s++;
  }
  if (suml == sumr)
    cout << "balance" << endl;
  else if (suml > sumr)
    cout << "left" << endl;
  else
    cout << "right" << endl;
  return 0;
}
