#include <bits/stdc++.h>
char lev[1000001];
int w[1000001] = {0};
int main() {
  int i, pos;
  long long int br = 0, bl = 0;
  scanf("%s", lev);
  int l = strlen(lev);
  for (i = 0; i < l; i++) {
    if (lev[i] >= '1' && lev[i] <= '9')
      w[i] = lev[i] - '0';
    else if (lev[i] == '^')
      pos = i;
  }
  for (i = 0; i < pos; i++) {
    bl += w[i] * (pos - i);
  }
  for (i = pos + 1; i < l; i++) br += w[i] * (i - pos);
  if (bl == br)
    printf("balance");
  else if (bl < br)
    printf("right");
  else
    printf("left");
  return 0;
}
