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