#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string s;
  long long pos, i, w_left = 0, w_right = 0;
  cin >> s;
  pos = s.find('^');
  for (i = 0; i < pos; i++) {
    if (s[i] == '=') continue;
    w_left += (pos - i) * (s[i] - '0');
  }
  for (i = pos + 1; i < s.length(); i++) {
    if (s[i] == '=') continue;
    w_right += (i - pos) * (s[i] - '0');
  }
  if (w_left > w_right)
    cout << "left" << endl;
  else if (w_left < w_right)
    cout << "right" << endl;
  else
    cout << "balance" << endl;
  return 0;
}
