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