#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string lever;
  cin >> lever;
  long long int left = 0, right = 0, mid, i = 0;
  while (lever[i] != '^') i++;
  mid = i;
  for (int i = mid - 1; i >= 0; i--) {
    if (lever[i] != '=') {
      int n = lever[i] - '0';
      left += n * (mid - i);
    }
  }
  for (int i = mid + 1; i < lever.size(); i++) {
    if (lever[i] != '=') {
      int n = lever[i] - '0';
      right += n * abs(mid - i);
    }
  }
  if (left == right) {
    cout << "balance" << endl;
  } else if (left < right) {
    cout << "right" << endl;
  } else
    cout << "left" << endl;
  return 0;
}
