#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  getline(cin, s);
  int ax = s.find('^');
  int dx = ax;
  long long int l = 0;
  for (int i = 0; i < ax; i++) {
    if (s[i] >= '1' && s[i] <= '9') {
      l += dx * (s[i] - '0');
    }
    dx--;
  }
  long long int r = 0;
  dx = 1;
  for (int i = ax + 1; i < s.length(); i++) {
    if (s[i] >= '1' && s[i] <= '9') {
      r += dx * (s[i] - '0');
    }
    dx++;
  }
  if (r > l)
    cout << "right" << endl;
  else if (r < l)
    cout << "left" << endl;
  else
    cout << "balance" << endl;
  return 0;
}
