#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e7 + 10;
int n, T, k, m;
int a[MAXN];
string s, t, p;
const int MOD = 1e9 + 7;
int main() {
  cin >> s;
  bool isL = 1;
  for (auto &&i : s) {
    if (i == '^') {
      isL = 0;
      continue;
    }
    if (isL)
      t += i;
    else
      p += i;
  }
  reverse(t.begin(), t.end());
  long long l = 0;
  for (long long i = 0; i < t.size(); i++)
    if (t[i] != '=') l += (1LL * (t[i] - 48)) * (i + 1);
  long long r = 0;
  for (long long i = 0; i < p.size(); i++)
    if (p[i] != '=') r += (1LL * (p[i] - 48)) * (i + 1);
  if (l == r)
    cout << "balance";
  else if (l > r)
    cout << "left";
  else
    cout << "right";
}
