#include <bits/stdc++.h>
using namespace std;
int INT_MAX_VAL = (int)0x3F3F3F3F;
int INT_MIN_VAL = (int)-0x3F3F3F3F;
long long LONG_MAX_VAL = (long long)0x3F3F3F3F3F3F3F3F;
long long LONG_MIN_VAL = (long long)-0x3F3F3F3F3F3F3F3F;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  long long left = 0;
  long long right = 0;
  int st = 0;
  while (s[st] != '^') ++st;
  for (int i = st - 1; i >= 0; --i) {
    if (s[i] >= '1' && s[i] <= '9') {
      left += (s[i] - '0') * (st - i);
    }
  }
  for (int i = st + 1; i < s.size(); ++i) {
    if (s[i] >= '1' && s[i] <= '9') {
      right += (s[i] - '0') * (i - st);
    }
  }
  if (left == right) {
    cout << "balance" << '\n';
  } else if (left > right) {
    cout << "left" << '\n';
  } else {
    cout << "right" << '\n';
  }
  return 0;
}
