#include <bits/stdc++.h>
using namespace std;
string s;
long long i, j, l, suml, sumr, mid;
int main() {
  cin >> s;
  l = s.length();
  for (i = 0; i < l; i++)
    if (s[i] == '^') {
      mid = i;
      break;
    }
  for (i = mid - 1; i >= 0; i--)
    if (s[i] != '=') suml += (mid - i) * (s[i] - 48);
  for (i = mid + 1; i < l; i++)
    if (s[i] != '=') sumr += (i - mid) * (s[i] - 48);
  if (suml > sumr) cout << "left";
  if (suml < sumr) cout << "right";
  if (suml == sumr) cout << "balance";
  return 0;
}
