#include <bits/stdc++.h>
using namespace std;
int main() {
  char ch[1000010];
  gets(ch);
  unsigned long long left, right, inc;
  int i, j;
  for (i = 0; ch[i] != '^';) {
    i++;
  }
  left = 0;
  inc = 0;
  for (j = i - 1; j >= 0; j--) {
    inc++;
    if (ch[j] >= '0' && ch[j] <= '9') left += (ch[j] - 48) * inc;
  }
  inc = 0;
  right = 0;
  for (j = i + 1; ch[j] != '\0'; j++) {
    inc++;
    if (ch[j] >= '0' && ch[j] <= '9') right += (ch[j] - 48) * inc;
  }
  if (left == right)
    printf("balance\n");
  else if (left > right)
    printf("left\n");
  else
    printf("right\n");
  return 0;
}
