#include <bits/stdc++.h>
using namespace std;
char s[1000006];
int main() {
  cin >> s;
  int sh = -1;
  for (int i = 0; i < strlen(s); i++) {
    if (s[i] == '^') {
      sh = i;
    }
  }
  long long left = 0;
  long long right = 0;
  for (int i = 0; i < strlen(s); i++) {
    if (s[i] != '=' && s[i] != '^' && i < sh) {
      left += ((int)(s[i] - '0') * (sh - i));
    } else if (s[i] != '=' && s[i] != '^' && i > sh) {
      right += ((int)(s[i] - '0') * (i - sh));
    }
  }
  if (left == right) {
    cout << "balance\n";
  } else if (left > right) {
    cout << "left\n";
  } else if (left < right) {
    cout << "right\n";
  }
}
