#include <bits/stdc++.h>
using namespace std;
char lever[1000001];
int find_pivot(char *lever, int len) {
  for (int i = 0; i < len; i++) {
    if (lever[i] == '^') return i;
  }
  return 0;
}
unsigned long long leftm(char *lever, int pivpos) {
  unsigned long long ans = 0;
  for (int i = 1; pivpos - i >= 0; i++) {
    if (lever[pivpos - i] != '=') {
      ans += ((lever[pivpos - i] - '0') * i);
    }
  }
  return ans;
}
unsigned long long rightm(char *lever, int pivpos, int len) {
  unsigned long long ans = 0;
  for (int i = 1; pivpos + i < len; i++) {
    if (lever[pivpos + i] != '=') {
      ans += ((lever[pivpos + i] - '0') * i);
    }
  }
  return ans;
}
int main() {
  scanf("%s", lever);
  int len = strlen(lever);
  int pivpos = find_pivot(lever, len);
  unsigned long long lmom = leftm(lever, pivpos);
  unsigned long long rmom = rightm(lever, pivpos, len);
  if (lmom == rmom)
    printf("balance\n");
  else if (lmom > rmom)
    printf("left\n");
  else
    printf("right\n");
  return 0;
}
