#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long f, tot = 0, a;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '^') {
      f = i;
      break;
    }
  }
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '^') break;
    if (s[i] - '0' <= 9) {
      a = f - i;
      tot += (s[i] - '0') * a;
    }
  }
  for (int i = f + 1; i < s.size(); i++) {
    if (s[i] - '0' <= 9) {
      a = i - f;
      tot -= (s[i] - '0') * a;
    }
  }
  if (tot > 0)
    cout << "left";
  else if (tot < 0)
    cout << "right";
  else
    cout << "balance";
}
