#include <bits/stdc++.h>
using namespace std;
char s[1000005];
int b[1000005];
int main(void) {
  scanf("%s", &s);
  string a = (string)s;
  int mid = -1;
  for (int i = 0; i < a.length(); i++) {
    if (a[i] == '^') {
      mid = i;
      b[i] = 0;
    } else if (a[i] == '=') {
      b[i] = 0;
    } else
      b[i] = (a[i] - 48);
  }
  long long total = 0;
  for (int i = 0; i < a.length(); i++) {
    total += (long long)b[i] * (long long)(mid - i);
  }
  if (total == 0) {
    printf("balance\n");
  } else if (total > 0)
    printf("left\n");
  else if (total < 0)
    printf("right\n");
  return 0;
}
