#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<int> a;
  vector<int> b;
  int flag = 0;
  long long ind = 0;
  long long c = 0, d = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '^') {
      flag = 1;
      ind = i;
    }
    if (s[i] != '^' && s[i] != '=') {
      if (flag == 0) {
        a.push_back(i);
      } else {
        b.push_back(i);
      }
    }
  }
  for (long long i = 0; i < a.size(); i++) {
    c = c + (s[a[i]] - '0') * (ind - a[i]);
  }
  for (long long i = 0; i < b.size(); i++) {
    d = d + (s[b[i]] - '0') * (b[i] - ind);
  }
  if (c != d) {
    if (c > d) {
      cout << "left";
    } else {
      cout << "right";
    }
  } else {
    cout << "balance";
  }
  return 0;
}
