#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  while (getline(cin, str)) {
    int len = str.length();
    long long lans, rans;
    lans = rans = 0;
    int pivot;
    for (int i = 0; i < len; i++)
      if (str[i] == '^') pivot = i, i = len;
    for (int i = 0; i < pivot; i++) {
      if (str[i] >= '0' && str[i] <= '9') {
        lans += (str[i] - '0') * (pivot - i);
      }
    }
    for (int i = pivot + 1; i < len; i++) {
      if (str[i] >= '0' && str[i] <= '9') {
        rans += (str[i] - '0') * (i - pivot);
      }
    }
    if (lans > rans)
      printf("left\n");
    else if (lans < rans)
      printf("right\n");
    else {
      printf("balance\n");
    }
  }
  return 0;
}
