#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  string s;
  cin >> s;
  long long n = s.length();
  long long idx = 0;
  for (; idx < n; idx++) {
    if (s[idx] == '^') break;
  }
  long long left = 0, right = 0;
  for (long long i = idx - 1; i >= 0; i--) {
    if (s[i] != '=') {
      left += ((s[i] - '0') * (idx - i));
    }
  }
  for (long long i = idx + 1; i < n; i++) {
    if (s[i] != '=') {
      right += ((s[i] - '0') * (i - idx));
    }
  }
  if (left > right)
    cout << "left";
  else if (left < right)
    cout << "right";
  else
    cout << "balance";
}
