#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  cin >> a;
  int s = a.size(), mid;
  long long sum = 0;
  for (int i = 0; i < s; i++) {
    if (a[i] == '^') {
      mid = i;
      break;
    }
  }
  for (int i = 0; i < s; i++) {
    int x = 0;
    if (isdigit(a[i])) x = a[i] - '0';
    sum += (x * (i - mid));
  }
  if (sum == 0) {
    cout << "balance";
  } else if (sum < 0) {
    cout << "left";
  } else
    cout << "right";
}
