#include <bits/stdc++.h>
using namespace std;
string st;
long long cp, w1, w2;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> st;
  for (int i = 0; i < st.size(); i++)
    if (st[i] == '^') cp = i;
  for (int i = 0; i < st.size(); i++)
    if (st[i] >= '0' && st[i] <= '9') {
      if (i < cp)
        w1 += (cp - i) * (st[i] - 48);
      else
        w2 += (i - cp) * (st[i] - 48);
    }
  if (w1 == w2)
    cout << "balance" << endl;
  else if (w1 > w2)
    cout << "left" << endl;
  else
    cout << "right" << endl;
  cin.get();
  cin.get();
  return 0;
}
