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