#include <bits/stdc++.h>
using namespace std;
int main() {
  long long right = 0, left = 0, index;
  string lever;
  cin >> lever;
  for (long i = 0; i < (long)lever.length(); i++) {
    if (lever[i] == '^') {
      index = i;
      break;
    }
  }
  for (long i = 0; i < (long)lever.length(); i++) {
    if ((int)lever[i] - 48 >= 1 && (int)lever[i] - 48 <= 9) {
      if (i < index) {
        left += (index - i) * ((int)lever[i] - 48);
      } else {
        right += (i - index) * ((int)lever[i] - 48);
      }
    }
  }
  if (left == right) {
    cout << "balance" << endl;
  } else if (left > right) {
    cout << "left" << endl;
  } else {
    cout << "right" << endl;
  }
}
