#include <bits/stdc++.h>
long long i, j;
using namespace std;
void solve() {
  string s, t1 = "", t2 = "";
  cin >> s;
  long long p = 0;
  long long ans1 = 0, ans2 = 0;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == '^')
      p = 1;
    else if (p == 0)
      t1 += s[i];
    else
      t2 += s[i];
  }
  int k = 1;
  for (i = t1.size() - 1; i >= 0; i--) {
    if (t1[i] == '=') {
      k++;
      continue;
    } else {
      ans1 += (t1[i] - '0') * (k);
      k++;
    }
  }
  for (i = 0; i < t2.size(); i++) {
    if (t2[i] == '=')
      continue;
    else {
      ans2 += (t2[i] - '0') * (i + 1);
    }
  }
  if (ans1 == ans2)
    cout << "balance";
  else if (ans1 > ans2)
    cout << "left";
  else
    cout << "right";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  {
    solve();
    cout << "\n";
  }
  return 0;
}
