#include <bits/stdc++.h>
using namespace std;
int INF = 1000000005;
long long INFF = 1000000000000000005LL;
int dirx[8] = {-1, 0, 0, 1, -1, -1, 1, 1};
int diry[8] = {0, 1, -1, 0, -1, 1, -1, 1};
double pi = 3.1415926536;
int MOD = 1e9 + 7;
long long power(long long x, long long n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * x;
    x = (x * x);
    n /= 2;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  string str;
  cin >> str;
  int mid;
  for (int i = 0; i <= str.length() - 1; i++) {
    if (str[i] == '^') {
      mid = i;
      break;
    }
  }
  long long sum = 0;
  for (int i = 0; i <= str.length() - 1; i++) {
    if (str[i] >= '1' && str[i] <= '9') {
      sum += (str[i] - '0') * (i - mid);
    }
  }
  if (sum > 0) {
    cout << "right\n";
  } else if (sum < 0)
    cout << "left\n";
  else
    cout << "balance\n";
}
