#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int idx;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '^') {
      idx = i;
      break;
    }
  }
  long long int lft = 0;
  for (int i = idx; i >= 0; i--) {
    if (s[i] != '=') {
      lft += ((s[i] - '0') * (idx - i));
    }
  }
  long long int rt = 0;
  for (int i = idx; i < s.length(); i++) {
    if (s[i] != '=') {
      rt += ((s[i] - '0') * (i - idx));
    }
  }
  if (lft > rt) {
    cout << "left";
  } else if (rt > lft)
    cout << "right";
  else if (lft == rt) {
    cout << "balance";
  }
  return 0;
}
