#include <bits/stdc++.h>
using namespace std;
int a[1000000];
int b[1000000];
int c[1000000];
long long n, m, k;
string s;
char r;
int main() {
  getline(cin, s);
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '^') {
      m = i;
      i = s.length();
    }
  }
  for (int i = 0; i < m; i++) {
    if (isdigit(s[i])) {
      if (s[i] == '1') c[i] = 1;
      if (s[i] == '2') c[i] = 2;
      if (s[i] == '3') c[i] = 3;
      if (s[i] == '4') c[i] = 4;
      if (s[i] == '5') c[i] = 5;
      if (s[i] == '6') c[i] = 6;
      if (s[i] == '7') c[i] = 7;
      if (s[i] == '8') c[i] = 8;
      if (s[i] == '9') c[i] = 9;
      b[i] = m - i;
      k = k + (b[i] * c[i]);
    }
  }
  for (int i = m + 1; i < s.length(); i++) {
    if (isdigit(s[i])) {
      if (s[i] == '1') c[i] = 1;
      if (s[i] == '2') c[i] = 2;
      if (s[i] == '3') c[i] = 3;
      if (s[i] == '4') c[i] = 4;
      if (s[i] == '5') c[i] = 5;
      if (s[i] == '6') c[i] = 6;
      if (s[i] == '7') c[i] = 7;
      if (s[i] == '8') c[i] = 8;
      if (s[i] == '9') c[i] = 9;
      b[i] = i - m;
      n = n + (b[i] * c[i]);
    }
  }
  if (k > n) cout << "left";
  if (n > k) cout << "right";
  if (n == k) cout << "balance";
  return 0;
}
