#include <bits/stdc++.h>
using namespace std;
string s;
long long ind;
int main() {
  cin >> s;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == '^') {
      ind = i;
    }
  }
  long long a = 0, b = 0;
  for (long long i = 0; i < ind; i++) {
    if (s[i] != '=') {
      a += (s[i] - '0') * (ind - i);
    }
  }
  for (long long i = ind + 1; i < s.size(); i++) {
    if (s[i] != '=') {
      b += (s[i] - '0') * (i - ind);
    }
  }
  if (a > b) {
    cout << "left" << endl;
  } else if (a < b) {
    cout << "right" << endl;
  } else {
    cout << "balance" << endl;
  }
  return 0;
}
