#include <bits/stdc++.h>
char s[1000005];
int main() {
  int i, k, n;
  long long mleft, mright;
  scanf(" %s", s);
  n = strlen(s);
  for (k = 0; k < n && s[k] != '^'; k++)
    ;
  mleft = 0;
  for (i = 0; i < k; i++) {
    if (s[i] != '=') mleft += (k - i) * (s[i] - '0');
  }
  mright = 0;
  for (i = k + 1; i < n; i++) {
    if (s[i] != '=') mright += (i - k) * (s[i] - '0');
  }
  if (mleft == mright)
    printf("balance");
  else if (mleft > mright)
    printf("left");
  else
    printf("right");
  return 0;
}
