#include <bits/stdc++.h>
int main() {
  char str[1000005];
  scanf("%[^\n]", &str);
  char center;
  bool centerflag = 0;
  long long lsum = 0, rsum = 0;
  long long index;
  for (int i = 0; i < strlen(str); i++) {
    if (str[i] == '^') {
      index = i;
      break;
    }
  }
  for (int i = 0; i < strlen(str); i++) {
    if (str[i] == '=') continue;
    if (str[i] >= '0' && str[i] <= '9') {
      if (i < index) {
        lsum += (str[i] - '0') * (index - i);
      } else if (i > index) {
        rsum += (str[i] - '0') * (i - index);
      }
    }
  }
  if (lsum > rsum)
    printf("left");
  else if (lsum < rsum)
    printf("right");
  else
    printf("balance");
  return 0;
}
