#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int main() {
  string s;
  cin >> s;
  long long L = 0, R = 0;
  int N = s.length();
  int f = find((s).begin(), (s).end(), '^') - s.begin();
  int i = 0, j = N - 1;
  while (s[i] != '^') {
    if (s[i] != '=') L += (f - i) * (s[i] - '0');
    i++;
  }
  while (s[j] != '^') {
    if (s[j] != '=') R += (j - f) * (s[j] - '0');
    j--;
  }
  if (L == R) cout << "balance";
  if (L < R) cout << "right";
  if (L > R) cout << "left";
  return 0;
}
