#include <bits/stdc++.h>
using namespace std;
char str[1000005];
int main() {
  while (scanf(" %s", str) != EOF) {
    int i, len = strlen(str);
    long long m, l = 0, r = 0;
    for (i = 0; i < len; i++)
      if (str[i] == '^') m = i;
    for (i = 0; i < len; i++)
      if (str[i] >= '1' && str[i] <= '9') {
        if (i < m)
          l += (m - i) * (str[i] - '0');
        else
          r += (i - m) * (str[i] - '0');
      }
    if (l > r)
      printf("left\n");
    else if (r > l)
      printf("right\n");
    else
      printf("balance\n");
  }
}
