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