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