#include <bits/stdc++.h>
using namespace std;
char ch[1000100];
long long dp[1000100];
long long pos[1000100];
long long r;
long long ri, li;
int main() {
  scanf("%s", ch);
  memset(dp, 0, sizeof(dp));
  memset(pos, 0, sizeof(pos));
  long long len = strlen(ch);
  li = 0;
  ri = 0;
  for (long long i = 0, k = 0; i < len; i++, k++) {
    if (ch[i] == '^') {
      k = 0;
      r = i;
      continue;
    }
    if (ch[i] != '=') {
      dp[i] = ch[i] - '0';
      pos[i] = k;
      continue;
    }
  }
  for (long long i = 0; i < r; i++) {
    li += ((r - pos[i]) * dp[i]);
  }
  for (long long i = r + 1; i < len; i++) {
    ri += ((pos[i]) * dp[i]);
  }
  if (li > ri)
    printf("left\n");
  else if (li < ri)
    printf("right\n");
  else
    printf("balance\n");
  return 0;
}
