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