#include <bits/stdc++.h>
using namespace std;
int main() {
  string l;
  cin >> l;
  unsigned long long left = 0, right = 0, accu = 0, dis = 1;
  int len = l.size();
  for (int i(0); i <= len - 1; ++i) {
    if (l[i] == '^') {
      for (int j(i + 1); j <= len - 1; ++j) {
        int v = 0;
        if (l[j] != '=') v = l[j] - '0';
        right += v * dis;
        dis++;
      }
      break;
    }
    int v = 0;
    if (l[i] != '=') v = l[i] - '0';
    left += accu + v;
    accu += v;
  }
  if (left > right)
    cout << "left" << endl;
  else if (right > left)
    cout << "right" << endl;
  else
    cout << "balance" << endl;
}
