#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x, y, dx, dy, z;
  string s;
  cin >> s;
  z = 0;
  while (s[z] != '^') {
    z++;
  }
  x = z - 1;
  dx = 0;
  while (0 <= x) {
    if (s[x] != '=') dx += (int(s[x]) - int('0')) * (z - x);
    x--;
  }
  y = z + 1;
  dy = 0;
  while (y < s.size()) {
    if (s[y] != '=') dy += (int(s[y]) - int('0')) * (y - z);
    y++;
  }
  if (dx > dy)
    cout << "left";
  else if (dx < dy)
    cout << "right";
  else
    cout << "balance";
  return 0;
}
