#include <bits/stdc++.h>
using namespace std;
const long long mod7 = 1000000007;
int arr[200001];
int sum[200001];
int used[200001];
int gcd(int a, int b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
int main() {
  string s;
  cin >> s;
  int i = 0;
  for (; i < s.length(); ++i)
    if (s[i] == '^') break;
  long long l = 0, r = 0;
  for (int j = 1; i - j >= 0; ++j) {
    if (s[i - j] != '=') {
      l += j * (s[i - j] - '0');
    }
  }
  for (int j = 1; i + j < s.length(); ++j) {
    if (s[i + j] != '=') {
      r += j * (s[i + j] - '0');
    }
  }
  if (l < r)
    cout << "right";
  else if (l == r)
    cout << "balance";
  else
    cout << "left";
  return 0;
}
