#include <bits/stdc++.h>
using namespace std;
char s[3000005];
long long cnt, cnt2, n;
long long a[200000 + 5], b[200000 + 5];
inline int judge() {
  int i;
  if (b[1] == b[2]) return 0;
  if (b[1] < b[2]) {
    for (i = 2; i < n; i++)
      if (b[i] >= b[i + 1]) return 0;
    return 1;
  }
  for (i = 2; i < n; i++)
    if (b[i] <= b[i + 1]) return 0;
  return 2;
}
inline bool equal() {
  int i;
  bool flag = 1;
  for (i = 1; i <= n; i++)
    if (a[i] != b[i]) {
      flag = 0;
      break;
    }
  if (flag) return 1;
  for (i = 1; i <= n; i++)
    if (a[n - i + 1] != b[i]) return 0;
  s[++cnt] = 'R';
  return 1;
}
inline void reverse() {
  int i, j;
  for (i = 1, j = n; i < j; i++, j--) swap(b[i], b[j]);
  return;
}
inline void diff() {
  int i;
  for (i = n; i > 1; i--) b[i] = b[i] - b[i - 1];
  return;
}
int main() {
  int i;
  scanf("%lld", &n);
  for (i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (i = 1; i <= n; i++) scanf("%lld", &b[i]);
  if (n == 1) {
    if (a[1] == b[1])
      printf("SMALL\n0\n");
    else
      printf("IMPOSSIBLE");
    return 0;
  }
  if (n == 2) {
    long long a1 = a[1], a2 = a[2], b1 = b[1], b2 = b[2];
    if (a1 > a2) swap(a1, a2);
    if (b1 > b2) swap(b1, b2);
    while (a1 != b1 && b1 > 0) {
      long long t = b1;
      cnt2 += b2 / b1;
      b1 = b2 % b1;
      b2 = t;
    }
    if (!b1 || b2 < a2) {
      printf("IMPOSSIBLE");
      return 0;
    } else if ((b2 - a2) % b1 == 0) {
      cnt2 += (b2 - a2) / b1;
      if (cnt2 > 200000) {
        printf("BIG\n%lld\n", cnt2);
        return 0;
      }
    } else {
      printf("IMPOSSIBLE");
      return 0;
    }
    cnt2 = 0;
  }
  while (1) {
    if (equal()) {
      if (cnt2 <= 200000) {
        printf("SMALL\n%lld\n", cnt);
        for (i = cnt; i > 0; i--) printf("%c", s[i]);
      } else
        printf("BIG\n%lld\n", cnt2);
      return 0;
    }
    int t = judge();
    if (!t) {
      printf("IMPOSSIBLE");
      return 0;
    }
    if (t == 2) {
      reverse();
      s[++cnt] = 'R';
    }
    diff();
    s[++cnt] = 'P';
    cnt2++;
  }
  return 0;
}
