#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int pivot = s.find('^');
  int64_t l = 0, r = 0;
  for (int i = pivot + 1; i < s.size(); ++i) {
    if (s[i] != '=') r += (s[i] - '0') * (int64_t)(i - pivot);
  }
  for (int i = pivot - 1; i >= 0; --i) {
    if (s[i] != '=') l += (s[i] - '0') * (int64_t)(pivot - i);
  }
  cout << (l > r ? "left\n" : l < r ? "right\n" : "balance\n");
  return 0;
}
