#include <bits/stdc++.h>
using namespace std;
bool sorting(pair<char, int> &a, pair<char, int> &b) {
  return a.second < b.second;
}
void solve() {
  int t = 1;
  while (t--) {
    string s;
    cin >> s;
    long long int sum = 0;
    int mid = s.find('^');
    for (int i = 0; i < s.size(); i++) {
      if (s[i] >= '1' && s[i] <= '9') {
        sum += (s[i] - '0') * (mid - i);
      }
    }
    if (sum == 0) {
      cout << "balance";
    } else if (sum < 0) {
      cout << "right";
    } else {
      cout << "left";
    }
  }
}
int main() {
  solve();
  return 0;
}
