#include <bits/stdc++.h>
using namespace std;
long long prime[1000000];
void sieve() {
  prime[0] = 0;
  prime[1] = 0;
  for (int i = 2; i < 1000000; i++) prime[i] = 1;
  for (int i = 2; i * i < 1000000; i++)
    if (prime[i] == 1)
      for (int j = i * i; j < 1000000; j += i) prime[j] = 0;
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  for (long long i = 2; i <= floor(sqrt(n)); i++)
    if (n % i == 0) return false;
  return true;
}
int countdigits(int N) {
  N = abs(N);
  while (N) {
    int dig = N % 10;
    if (dig == 8) {
      return 1;
    }
    N = N / 10;
  }
  return 0;
}
void solve() {
  string S;
  int save;
  long long sum1 = 0, sum2 = 0;
  cin >> S;
  for (int i = 0; i < S.size() - 1; i++) {
    if (S[i] == '^') {
      save = i;
      break;
    }
  }
  for (int i = 0; i < S.size() - 1; i++) {
    if (S[i] != '^') {
      if (S[i] >= '0' && S[i] <= '9')
        sum1 = sum1 + ((save - i) * (int(S[i]) - 48));
    } else if (S[i] == '^')
      break;
  }
  for (int i = S.size() - 1; i >= 0; i--) {
    if (S[i] != '^') {
      if (S[i] >= '0' && S[i] <= '9')
        sum2 = sum2 + ((i - save) * (int(S[i]) - 48));
    } else if (S[i] == '^')
      break;
  }
  if (sum1 == sum2)
    cout << "balance";
  else if (sum1 < sum2)
    cout << "right";
  else
    cout << "left";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
