#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  long long mid = 0;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == '^') {
      mid = i;
      break;
    }
  }
  long long sum = 0;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] != '=' && s[i] != '^') sum += (s[i] - '0') * (i - mid);
  }
  if (sum == 0) {
    cout << "balance\n";
  }
  if (sum < 0) {
    cout << "left\n";
  }
  if (sum > 0) {
    cout << "right\n";
  }
  return 0;
}
