#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int l = s.length();
  int q;
  for (int a = 0; a < l; a++) {
    if (s[a] == '^') q = a;
  }
  long long int lf{0}, rit{0};
  for (int a = 0; a < l; a++) {
    int m = s[a];
    if (m > 48 && m < 58) {
      if (q - a > 0) {
        lf = lf + (m - 48) * (q - a);
      } else if (q - a < 0) {
        rit = rit + (m - 48) * (q - a) * (-1);
      }
    }
  }
  if (rit == lf)
    cout << "balance";
  else if (rit > lf)
    cout << "right";
  else
    cout << "left";
}
