#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long int n = s.length(), l = 0, r = 0, o, k, h, z = 1;
  char p;
  o = s.find('^');
  for (int i = o - 1; i >= 0; i--) {
    if (s[i] != '=') {
      l = l + (s[i] - '0') * z;
    }
    z++;
  }
  z = 1;
  for (int i = o + 1; i < n; i++) {
    if (s[i] != '=') {
      r = r + (s[i] - '0') * (z);
    }
    z++;
  }
  if (r == l) {
    cout << "balance" << endl;
  } else if (r > l) {
    cout << "right" << endl;
  } else if (r < l) {
    cout << "left" << endl;
  }
  return 0;
}
