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