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