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