#include <bits/stdc++.h>
using namespace std;
char s[1000001], ch, w[1000001];
int ara[1000000];
int main() {
  int a, b, c, i, j, k, tc, t;
  int n, m, cnt = 0, mid;
  long long l = 0, r = 0, tmp, tmp1;
  scanf("%s", s);
  int len = strlen(s);
  for (i = 0; i < len; i++) {
    if (s[i] != '=' && s[i] != '^') break;
    if (i == len - 1) {
      printf("balance\n");
      return 0;
    }
  }
  for (i = 0; i < len; i++) {
    if (s[i] == '^') {
      mid = i + 1;
    }
  }
  for (i = 0; i < len; i++) {
    if (s[i] >= '1' && s[i] <= '9') {
      tmp = 0;
      if ((i + 1) < mid) {
        tmp = (s[i] - '0');
        tmp1 = (long long)mid - (long long)(i + 1);
        l += tmp * tmp1;
      } else if (i + 1 > mid) {
        tmp = s[i] - '0';
        tmp1 = (long long)(i + 1) - (long long)mid;
        r += tmp * tmp1;
      }
    }
  }
  if (l == r)
    printf("balance\n");
  else if (l > r)
    printf("left\n");
  else
    printf("right\n");
  return 0;
}
