#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T gcd(T a, T b) {
  return b == 0 ? a : gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  return (a / gcd(a, b)) * b;
}
long long int b[1000000 + 5];
int main() {
  string s;
  cin >> s;
  int l = s.size();
  int p;
  for (int i = 0; i < (l); i++)
    if (s[i] == '^') {
      p = i + 1;
      break;
    }
  for (int i = 0; i < (l); i++) {
    int j = i + 1;
    if (s[i] >= '0' && s[i] <= '9') {
      b[j] = (s[i] - '0') * (abs(p - j));
    }
  }
  long long int n, m;
  n = m = 0;
  for (int i = 0; i < (l + 1); i++) {
    if (i + 1 < p)
      n += b[i + 1];
    else
      m += b[i + 1];
  }
  if (n == m)
    cout << "balance" << endl;
  else if (n < m)
    cout << "right" << endl;
  else
    cout << "left" << endl;
  return 0;
}
