#include <bits/stdc++.h>
using namespace std;
int maximum(int a, int b) {
  if (a > b)
    return a;
  else
    return b;
}
char in[1000009];
int main() {
  long long int i, idx;
  scanf("%s", in);
  long long int l = strlen(in);
  for (i = 0; i < l; i++) {
    if (in[i] == '^') idx = i + 1;
  }
  long long int temp = idx - 1;
  long long int right = 0, left = 0;
  for (i = 0; i < l; i++) {
    if (i < temp) {
      if (in[i] == '=') continue;
      left += (long long int)(in[i] - '0') * (idx - i - 1);
    }
    if (i > temp) {
      if (in[i] == '=') continue;
      right += (in[i] - '0') * (i + 1 - idx);
    }
  }
  if (left > right)
    printf("left\n");
  else if (right > left)
    printf("right\n");
  else if (right == left)
    printf("balance\n");
  return 0;
}
