#include <bits/stdc++.h>
using namespace std;
long long a[200000], b[200000];
long long dirpos(long long n) {
  for (long long i = 1; i < n; i++)
    if (b[i] <= b[i - 1]) return 0;
  return 1;
}
long long dirneg(long long n) {
  for (long long i = 1; i < n; i++)
    if (b[i] >= b[i - 1]) return 0;
  return 1;
}
bool eql(long long n) {
  for (long long i = 0; i < n; i++)
    if (a[i] != b[i]) return 0;
  return 1;
}
bool rev(long long n) {
  for (long long i = 0, j = n - 1; i < n; i++, j--)
    if (a[i] != b[j]) return 0;
  return 1;
}
int main() {
  long long i, j, k;
  long long n;
  string op;
  scanf("%lld", &n);
  for (i = 0; i < n; i++) scanf("%lld", &a[i]);
  for (i = 0; i < n; i++) scanf("%lld", &b[i]);
  if (n == 1) {
    if (a[0] == b[0]) {
      printf("SMALL\n0");
    } else {
      printf("IMPOSSIBLE");
    }
    return 0;
  }
  if (n == 2) {
    long long c[2];
    c[0] = b[0];
    c[1] = b[1];
    long long pcnt = 0;
    while (1) {
      if (a[0] == c[0] && a[1] == c[1]) break;
      if (a[0] == c[1] && a[1] == c[0]) {
        op.push_back('R');
        break;
      }
      if (c[0] < c[1]) {
        pcnt++;
        if (pcnt > 200000) goto l;
        op.push_back('P');
        for (i = n - 1; i > 0; i--) c[i] -= c[i - 1];
      } else if (c[0] > c[1]) {
        op.push_back('R');
        swap(c[0], c[1]);
      } else {
        printf("IMPOSSIBLE");
        return 0;
      }
    }
    reverse(op.begin(), op.end());
    printf("SMALL\n%lld\n", (long long)op.length());
    cout << op;
    return 0;
  l:;
    c[0] = b[0];
    c[1] = b[1];
    long long pcnt1 = 0;
    while (1) {
      if (a[0] == c[0] && a[1] == c[1]) {
        break;
      }
      if (c[0] <= 0 || c[1] <= 0) {
        pcnt1 = 2000000000000000;
        break;
      }
      if (c[0] > c[1]) swap(c[0], c[1]);
      if ((c[1] - a[1]) % c[0] == 0 && c[0] == a[0]) {
        pcnt1 += (c[1] - a[1]) / c[0];
        break;
      }
      if (c[0] == c[1]) {
        pcnt1 = 2000000000000000;
        break;
      }
      long long tcnt =
          (c[1] - c[0]) / c[0] - (long long)((c[1] - c[0]) % c[0] == 0) + 1;
      pcnt1 += tcnt;
      c[1] -= tcnt * c[0];
      swap(c[0], c[1]);
    }
    swap(a[0], a[1]);
    c[0] = b[0];
    c[1] = b[1];
    long long pcnt2 = 0;
    while (1) {
      if (a[0] == c[0] && a[1] == c[1]) break;
      if (c[0] <= 0 || c[1] <= 0) {
        pcnt2 = 2000000000000000;
        break;
      }
      if (c[0] > c[1]) swap(c[0], c[1]);
      if ((c[1] - a[1]) % c[0] == 0 && c[0] == a[0]) {
        pcnt2 += (c[1] - a[1]) / c[0];
        break;
      }
      if (c[0] == c[1]) {
        pcnt2 = 2000000000000000;
        break;
      }
      long long tcnt =
          (c[1] - c[0]) / c[0] - (long long)((c[1] - c[0]) % c[0] == 0) + 1;
      pcnt2 += tcnt;
      c[1] -= tcnt * c[0];
      swap(c[0], c[1]);
    }
    if (pcnt1 == 2000000000000000 && pcnt2 == 2000000000000000) {
      printf("IMPOSSIBLE");
      return 0;
    }
    printf("BIG\n");
    printf("%lld", min(pcnt1, pcnt2));
    return 0;
  }
  long long pcnt = 0;
  while (1) {
    if (eql(n)) break;
    if (rev(n)) {
      op.push_back('R');
      break;
    }
    if (dirpos(n)) {
      pcnt++;
      op.push_back('P');
      for (i = n - 1; i > 0; i--) b[i] -= b[i - 1];
    } else if (dirneg(n)) {
      op.push_back('R');
      reverse(b, b + n);
    } else {
      printf("IMPOSSIBLE");
      return 0;
    }
  }
  reverse(op.begin(), op.end());
  if (pcnt > 200000) {
    printf("BIG\n");
    printf("%lld", pcnt);
  } else {
    printf("SMALL\n%lld\n", (long long)op.length());
    cout << op;
  }
}
