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