#include <bits/stdc++.h>
int main() {
  char str[1000002];
  long long i, j, k, l, sa = 0, sb = 0;
  gets(str);
  for (i = 0; str[i] != '\0'; i++) {
    if (str[i] == '^') break;
  }
  for (j = i - 1, k = 1; j >= 0; j--, k++) {
    if (str[j] >= '1' && str[j] <= '9') sa += (str[j] - '0') * k;
  }
  for (j = i + 1, k = 1; str[j] != '\0'; j++, k++) {
    if (str[j] >= '1' && str[j] <= '9') sb += (str[j] - '0') * k;
  }
  if (sa == sb)
    printf("balance\n");
  else if (sa > sb)
    printf("left\n");
  else if (sa < sb)
    printf("right\n");
  return 0;
}
