#include <bits/stdc++.h>
using namespace std;
int main() {
  string x;
  int t;
  cin >> x;
  int s = x.size();
  for (int i = 0; i < s; i++) {
    if (x[i] == '^') {
      t = i;
    }
  }
  long long int sum1 = 0, sum2 = 0;
  for (int i = 0; i < t; i++) {
    if (49 <= x[i] && x[i] <= 57) sum1 = sum1 + ((x[i] - 48) * (t - i));
  }
  for (int i = t + 1; i < s; i++) {
    if (49 <= x[i] && x[i] <= 57) sum2 = sum2 + ((x[i] - 48) * (i - t));
  }
  if (sum1 == sum2) {
    cout << "balance" << endl;
  } else if (sum1 > sum2) {
    cout << "left" << endl;
  } else
    cout << "right" << endl;
  return 0;
}
