#include <bits/stdc++.h>
int a[1000000], b[1000000], i, k, n;
char c;
long long s;
int main() {
  while (~scanf("%c", &c)) {
    if (c == '^') k = i;
    if (c >= 48 && c <= 57) {
      b[n] = i;
      a[n++] = c - 48;
    }
    ++i;
  }
  for (i = 0; i < n; i++) s += (long long)(k - b[i]) * a[i];
  printf(!s ? "balance" : s > 0 ? "left" : "right");
  return 0;
}
