#include <bits/stdc++.h>
using namespace std;
template <typename T, typename S>
inline void chkmin(T &a, const S &b) {
  a = a < b ? a : b;
}
template <typename T, typename S>
inline void chkmax(T &a, const S &b) {
  a = a > b ? a : b;
}
const int MAXN = 200005, MAXM = 500005;
long long A[MAXN], B[MAXN];
int n;
char ans[MAXM];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", A + i);
  for (int i = 1; i <= n; i++) scanf("%lld", B + i);
  if (n == 1) {
    if (A[1] == B[1]) return puts("SMALL\n0"), 0;
    return puts("IMPOSSIBLE"), 0;
  }
  if (n == 2) {
    bool rev = false;
    if (A[2] < A[1]) {
      rev = true;
      swap(A[2], A[1]);
    }
    int tot = 0;
    long long cnt = 0;
    while (true) {
      if (B[2] < B[1]) {
        if (tot <= 5e5) ans[tot++] = 'R';
        swap(B[2], B[1]);
      }
      if (B[1] == A[1]) {
        if ((B[2] - A[2]) % A[1] == 0) {
          long long t = (B[2] - A[2]) / A[1];
          cnt += t;
          if (t + tot <= 5e5)
            for (int i = 0; i < t; i++) ans[tot++] = 'P';
          B[2] = A[2];
          break;
        }
      }
      if (B[2] % B[1] == 0) return puts("IMPOSSIBLE"), 0;
      long long t = B[2] / B[1];
      cnt += t;
      if (t + tot <= 5e5)
        for (int i = 0; i < t; i++) ans[tot++] = 'P';
      B[2] %= B[1];
    }
    if (cnt <= 2e5) {
      puts("SMALL");
      if (rev) ans[tot++] = 'R';
      printf("%d\n", tot);
      reverse(ans, ans + tot);
      puts(ans);
    } else {
      puts("BIG");
      printf("%lld\n", cnt);
    }
    return 0;
  }
  int tot = 0, cnt = 0;
  for (int i = 1; i <= 2e6; i++) {
    bool ab = true, ba = true, equ1 = true, equ2 = true;
    for (int j = 1; j < n; j++) {
      ab &= B[j] < B[j + 1];
      ba &= B[j] > B[j + 1];
    }
    for (int j = 1; j <= n; j++) {
      equ1 &= A[j] == B[j];
      equ2 &= A[j] == B[n - j + 1];
    }
    if (equ2) ans[tot++] = 'R';
    if (equ1 || equ2) break;
    if (!ab && !ba) return puts("IMPOSSIBLE"), 0;
    if (ba) {
      if (tot <= 5e5) ans[tot++] = 'R';
      reverse(B + 1, B + 1 + n);
    }
    ++cnt;
    if (tot <= 5e5) ans[tot++] = 'P';
    for (int j = n; j > 0; j--) B[j] = B[j] - B[j - 1];
  }
  if (cnt <= 2e5) {
    puts("SMALL");
    printf("%d\n", tot);
    reverse(ans, ans + tot);
    puts(ans);
  } else {
    puts("BIG");
    printf("%d\n", cnt);
  }
  return 0;
}
