#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long p = 0, res = 0, n = s.length();
  for (int i = 0; i < n; i++)
    if (s[i] == '^') {
      p = i;
      break;
    }
  for (int i = 0; i < n; i++) {
    if (s[i] == '^' || s[i] == '=') continue;
    res += (s[i] - '0') * (p - i);
  }
  if (res == 0)
    cout << "balance" << endl;
  else if (res < 0)
    cout << "right" << endl;
  else
    cout << "left" << endl;
  return 0;
}
