#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)1e2 + 50;
const int INF = (int)1e6;
string second;
string rs;
bool b;
long long ll, rr, cnt;
int main() {
  cin >> second;
  rs = second;
  reverse(rs.begin(), rs.end());
  for (int i = 0; i < second.size(); i++) {
    if (!b) {
      if (second[i] == '^') {
        b = true;
      }
    } else {
      cnt++;
      if (second[i] != '=') {
        rr += cnt * (second[i] - '0');
      }
    }
  }
  b = false;
  cnt = 0;
  for (int i = 0; i < rs.size(); i++) {
    if (!b) {
      if (rs[i] == '^') {
        b = true;
      }
    } else {
      cnt++;
      if (rs[i] != '=') {
        ll += cnt * (rs[i] - '0');
      }
    }
  }
  if (ll == rr) {
    cout << "balance";
  } else {
    if (ll > rr) {
      cout << "left";
    } else {
      cout << "right";
    }
  }
  return 0;
}
