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