#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int n = str.size();
  int k;
  for (int i = 0; i < n; i++) {
    if (str[i] == '=') str[i] = '0';
    if (str[i] == '^') {
      k = i;
      str[i] = '0';
    }
  }
  long long int m1 = 0;
  long long int m2 = 0;
  for (int i = 0; i < n; i++) {
    if (i <= k)
      m1 += (str[i] - '0') * (k - i);
    else
      m2 += (str[i] - '0') * (i - k);
  }
  if (m1 > m2)
    cout << "left";
  else if (m1 < m2)
    cout << "right";
  else
    cout << "balance";
  return 0;
}
