#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long int level = s.find('^');
  long long int leftw = 0;
  long long int rightw = 0;
  for (long long int i = 0; i < level; ++i) {
    if (s[i] != '=') {
      leftw += (s[i] - '0') * (level - i);
    }
  }
  for (long long int i = level + 1; i < s.length(); ++i) {
    if (s[i] != '=') {
      rightw += (s[i] - '0') * (i - level);
    }
  }
  if (rightw == leftw) {
    cout << "balance" << '\n';
  } else if (rightw > leftw) {
    cout << "right" << '\n';
  } else {
    cout << "left" << '\n';
  }
  return 0;
}
