#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAXN = 2e5;
int n;
vector<ll> A, B;
string ans;
ll cntP = 0;
bool allEq(bool rev) {
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    if (A[i] != B[rev ? n - 1 - i : i]) {
      return false;
    }
  }
  return true;
}
bool valid(bool rev) {
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    if (A[i] > B[rev ? n - 1 - i : i]) {
      return false;
    }
  }
  return true;
}
bool solve() {
  if (n == 1) return A[0] == B[0];
  ll sum = A[0] + A[1];
  while (true) {
    if (allEq(false)) {
      return true;
    }
    if (allEq(true)) {
      ans += 'R';
      return true;
    }
    if (!valid(false) && !valid(true)) return false;
    if (B[0] > B[1]) {
      ans += 'R';
      reverse(begin(B), end(B));
    }
    if (n == 2) {
      ll x = min(B[1], B[1] + B[0] - sum) / B[0];
      if (x == 0) return false;
      B[1] -= x * B[0];
      cntP += x;
      if (cntP <= MAXN) {
        ans += string(x, 'P');
      }
    } else {
      cntP++;
      ans += 'P';
      for (__typeof(0) i = (n) - ((n) > (0)); i != (0) - ((n) > (0));
           i += 1 - 2 * ((n) > (0))) {
        B[i] -= (i == 0 ? 0 : B[i - 1]);
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  A.resize(n);
  B.resize(n);
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    cin >> A[i];
  }
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    cin >> B[i];
  }
  if (solve()) {
    reverse(begin(ans), end(ans));
    if (cntP <= MAXN) {
      printf("SMALL\n%d\n%s\n", (int)ans.size(), ans.c_str());
    } else {
      printf("BIG\n%lld\n", cntP);
    }
  } else {
    puts("IMPOSSIBLE");
  }
}
