#include <bits/stdc++.h>
char a[1000002];
int b[1000002];
int main() {
  long long tilt = 0;
  int axis, length, i, j;
  scanf("%s", &a);
  for (i = 0; a[i] != '\0'; i++) {
    if (a[i] == '=')
      b[i] = 0;
    else if (a[i] == '^') {
      axis = i;
      b[i] = 0;
    } else
      b[i] = a[i] - '0';
  }
  length = i;
  for (i = 0; i < axis; i++) {
    tilt = tilt - (b[i] * (axis - i));
  }
  for (i = axis + 1; i < length; i++) {
    tilt = tilt + (b[i] * (i - axis));
  }
  if (tilt < 0)
    printf("left");
  else if (tilt > 0)
    printf("right");
  else
    printf("balance");
  return 0;
}
