#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  unsigned long long suml = 0, sumr = 0;
  int i;
  int piv;
  for (int i = 0; i < s.size(); i++)
    if (s[i] == '^') piv = i;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == '^') break;
    if (s[i] <= '9' && s[i] >= '0') {
      unsigned long long val = 1ll * (piv - i) * (s[i] - '0');
      suml += val;
    }
  }
  i++;
  for (; i < s.size(); i++) {
    if (s[i] <= '9' && s[i] >= '0') {
      unsigned long long val = 1ll * (i - piv) * (s[i] - '0');
      sumr += val;
    }
  }
  if (sumr == suml)
    cout << "balance";
  else if (sumr < suml)
    cout << "left";
  else
    cout << "right";
  return 0;
}
