#include <bits/stdc++.h>
using namespace std;
int main() {
  int c;
  long long int left = 0, right = 0;
  bool flag = false;
  string str;
  getline(cin, str);
  int n = str.length();
  for (int i = 0; i < n; i++) {
    if (str[i] == '^') {
      c = i;
      break;
    }
  }
  for (int i = 0; i < n; i++) {
    if (str[i] >= '0' && str[i] <= '9') {
      int t = str[i] - '0';
      if (!flag) {
        left = left + (t * (c - i));
      } else {
        right = right + (t * (i - c));
      }
    } else if (str[i] == '^') {
      flag = true;
    }
  }
  if (left > right) {
    cout << "left" << endl;
  } else if (right > left) {
    cout << "right" << endl;
  } else {
    cout << "balance" << endl;
  }
}
