#include <bits/stdc++.h>
using namespace std;
template <class T>
inline std::string to_string(const T& t) {
  std::stringstream ss;
  ss << t;
  return ss.str();
}
template <class T>
inline long long to_longlong(const T& t) {
  std::stringstream ss;
  long long val;
  ss.str(t);
  ss >> val;
  return val;
}
inline long long pow(const long long& x, const long long& y) {
  if (y == 0)
    return 1;
  else
    return x * pow(x, y - 1);
}
int main() {
  string s;
  vector<long long> a, b;
  long long left = 0, right = 0;
  int pivot;
  getline(cin, s);
  pivot = s.find('^');
  for (int i = 0; i < pivot; i++) {
    if (s[i] != '=') {
      left += (s[i] - '0') * (pivot - i);
    }
  }
  for (int i = pivot + 1; i < s.length(); i++) {
    if (s[i] != '=') {
      right += (s[i] - '0') * (i - pivot);
    }
  }
  if (left == right)
    cout << "balance" << endl;
  else if (left > right)
    cout << "left" << endl;
  else
    cout << "right" << endl;
  return 0;
}
