#include <bits/stdc++.h>
using namespace std;
int main() {
  int j, t, n, m = 0, i;
  unsigned long long p = 0, q = 0;
  char a[1000001];
  cin >> a;
  n = strlen(a);
  for (j = 0; j < n; j++) {
    if (a[j] == '^') {
      break;
    }
  }
  for (i = j - 1; i >= 0; i--) {
    if ((a[i] >= '1') && (a[i] <= '9')) {
      t = abs(j - i);
      p += (t * ((int)a[i] - 48));
    }
  }
  for (i = j + 1; i < n; i++) {
    if ((a[i] >= '1') && (a[i] <= '9')) {
      t = abs(j - i);
      q += (t * ((int)a[i] - 48));
    }
  }
  if (p == q) {
    cout << "balance" << endl;
  } else if (p > q) {
    cout << "left" << endl;
  } else {
    cout << "right" << endl;
  }
}
