#include <bits/stdc++.h>
using namespace std;
const long long N = 50 + 7;
long long int n, T, cnt = 0, m, mn = N, ans, x, k;
vector<string> v, v2, dq, v1;
map<char, int> mp;
string s;
set<char> st;
char a[N][N];
void solve() {
  string s;
  cin >> s;
  x = s.find('^');
  for (int i = 0; i < s.size(); i++) {
    if (s[i] >= '0' and s[i] <= '9') {
      cnt += (s[i] - '0') * (i - x);
    }
  }
  if (cnt == 0) {
    cout << "balance";
  } else if (cnt > 0) {
    cout << "right";
  } else
    cout << "left";
}
int main() {
  ios_base::sync_with_stdio(0);
  int T = 1;
  while (T--) {
    solve();
  }
}
