#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long sum = 0;
  int mid = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '^') {
      mid = i;
    }
  }
  long long val = 0;
  for (int i = 0; i < s.length(); i++) {
    if (isdigit(s[i])) {
      val = s[i] - '0';
    } else {
      val = 0;
    }
    sum += val * (i - mid);
  }
  if (sum == 0) {
    cout << "balance" << endl;
  } else if (sum > 0) {
    cout << "right" << endl;
  } else {
    cout << "left" << endl;
  }
}
