#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int p = s.size();
  long long right = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '^') {
      p = i;
    }
    if (i > p && s[i] != '=') {
      right += (i - p) * (s[i] - 48);
    }
  }
  long long left = 0;
  for (int i = 0; i < p; i++) {
    if (s[i] != '=') {
      left += (p - i) * (s[i] - 48);
    }
  }
  if (left > right) {
    cout << "left";
  } else if (right > left) {
    cout << "right";
  } else {
    cout << "balance";
  }
}
