#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int le = 0;
  int64_t l = 0, r = 0;
  cin >> s;
  for (int i = 0; i < s.size(); i++)
    if (s[i] == '^') le = i;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '^' || s[i] == '=') continue;
    if (i < le) {
      l += (le - i) * (s[i] - '0');
    } else {
      r += (i - le) * (s[i] - '0');
    }
  }
  if (l == r) {
    cout << "balance" << endl;
  } else if (l < r) {
    cout << "right" << endl;
  } else {
    cout << "left" << endl;
  }
}
