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