#include <bits/stdc++.h>
using namespace std;
long long int a, b, i, j, k, n, m, ans = 1, len = 0;
long long int cnt = 0, fl = 0, a2, a3 = -1000000, i1, x, y, z, u;
string s;
int main() {
  cin >> s;
  n = s.size();
  for (i = 0; i < n; i++) {
    if (s[i] == '^') x = i;
  }
  for (i = 0; i < n; i++) {
    if (s[i] == '=' || s[i] == '^') continue;
    if (i < x) {
      cnt += ((s[i] - 48) * abs(x - i));
    } else {
      len += ((s[i] - 48) * abs(x - i));
    }
  }
  if (len < cnt)
    cout << "left\n";
  else if (len > cnt)
    cout << "right\n";
  else
    cout << "balance\n";
  return 0;
}
