#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  while (cin >> s) {
    long long i, k = 0, t = 0, t1 = 0, t2 = 0, n;
    n = s.size();
    for (int i = 0, _n = n; i < _n; i++) {
      if (s[i] == '^') {
        k = i + 1;
        break;
      }
    }
    for (i = 0; i < k - 1; i++) {
      if (s[i] == '=')
        continue;
      else {
        t = s[i] - 48;
        t1 += t * (k - i - 1);
      }
    }
    t = 0;
    for (i = k; i < n; i++) {
      if (s[i] == '=')
        continue;
      else {
        t = s[i] - 48;
        t2 += t * (i - k + 1);
      }
    }
    if (t1 == t2)
      cout << "balance" << endl;
    else if (t1 > t2)
      cout << "left" << endl;
    else
      cout << "right" << endl;
  }
  return 0;
}
