#include <bits/stdc++.h>
using namespace std;
int main() {
  char inp[1000000 + 5];
  gets(inp);
  long long int l = 0, status, r = 0, p;
  bool lflag = 0, rflag = 0;
  for (int i = 0; i < strlen(inp); i++) {
    if (inp[i] == '^') {
      p = i;
      break;
    }
  }
  for (int i = 0; i < p; i++) {
    if (inp[i] >= '0' && inp[i] <= '9') l += (inp[i] - 48) * (p - i);
  }
  for (int i = p + 1; i < strlen(inp); i++) {
    if (inp[i] >= '0' && inp[i] <= '9') r += (inp[i] - 48) * (i - p);
  }
  if (l == r)
    printf("balance\n");
  else if (l > r)
    printf("left\n");
  else
    printf("right\n");
  return 0;
}
