#include <bits/stdc++.h>
using namespace std;
const int maxn = 200003;
int n;
long long a[maxn], b[maxn], ans[10000005] = {0};
void check() {
  int c = 0;
  int ok1 = 1, ok2 = 1;
  for (int i = 1; i <= n; ++i) {
    if (a[i] != b[i]) ok1 = 0;
    if (a[i] != b[n - i + 1]) ok2 = 0;
  }
  if (!ok1 && ok2) ok1 = 1, ans[++ans[0]] = -1;
  if (ok1) {
    long long tot1 = 0, tot2 = 0;
    for (int i = 1; i <= ans[0]; ++i)
      tot1 += ans[i] == -1 ? 1 : ans[i], tot2 += ans[i] == -1 ? 0 : ans[i];
    if (tot2 > 200000)
      printf("BIG\n%lld\n", tot2);
    else {
      printf("SMALL\n%lld\n", tot1);
      for (int i = ans[0]; i >= 1; --i)
        if (ans[i] == -1)
          printf("R");
        else {
          int x = ans[i];
          while (x--) printf("P");
        }
      printf("\n");
    }
    exit(0);
  }
}
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]);
  check();
  if (n == 1) {
    if (a[1] == b[1])
      printf("SMALL\n0\n\n");
    else
      printf("IMPOSSIBLE\n");
    return 0;
  }
  if (n == 2) {
    if (b[1] == b[2]) return printf("IMPOSSIBLE\n"), 0;
    while (1) {
      if (b[1] > b[2]) swap(b[1], b[2]), ans[++ans[0]] = -1;
      if (b[1] == a[1]) {
        long long dif = b[2] - a[2];
        if (dif < 0 || dif % a[1] != 0) return printf("IMPOSSIBLE\n"), 0;
        ans[++ans[0]] = dif / a[1];
        break;
      }
      if (b[1] == a[2]) {
        long long dif = b[2] - a[1];
        if (dif < 0 || dif % b[1] != 0) return printf("IMPOSSIBLE\n"), 0;
        ans[++ans[0]] = dif / b[1];
        ans[++ans[0]] = -1;
        break;
      }
      if (b[2] % b[1] == 0) return printf("IMPOSSIBLE\n"), 0;
      ans[++ans[0]] = b[2] / b[1];
      b[2] %= b[1];
    }
    long long tot1 = 0, tot2 = 0;
    for (int i = 1; i <= ans[0]; ++i)
      tot1 += ans[i] == -1 ? 1 : ans[i], tot2 += ans[i] == -1 ? 0 : ans[i];
    if (tot2 > 200000)
      printf("BIG\n%lld\n", tot2);
    else {
      printf("SMALL\n%lld\n", tot1);
      for (int i = ans[0]; i >= 1; --i)
        if (ans[i] == -1)
          printf("R");
        else {
          int x = ans[i];
          while (x--) printf("P");
        }
      printf("\n");
    }
    return 0;
  }
  while (1) {
    if (b[1] == b[n]) return printf("IMPOSSIBLE\n"), 0;
    if (b[1] > b[n]) {
      reverse(b + 1, b + n + 1), ans[++ans[0]] = -1;
    } else {
      int ok = 1;
      for (int i = 2; i <= n; ++i)
        if (b[i] <= b[i - 1]) ok = 0;
      if (!ok) return printf("IMPOSSIBLE\n"), 0;
      for (int i = n; i >= 2; --i) b[i] -= b[i - 1];
      ans[++ans[0]] = 1;
    }
    check();
  }
  return 0;
}
