#include <bits/stdc++.h>
using namespace std;
int n;
long long a[200005], b[200005];
long long c[200005];
bool check() {
  for (int i = 1; i <= n; i++)
    if (a[i] != b[i]) return false;
  return true;
}
bool f_check() {
  for (int i = 1; i <= n; i++)
    if (a[i] != b[n + 1 - i]) return false;
  return true;
}
void re() {
  for (int i = 1; i <= n; i++) c[i] = b[n + 1 - i];
  for (int i = 1; i <= n; i++) b[i] = c[i];
}
void rollback() {
  c[1] = b[1];
  for (int i = 2; i <= n; i++) c[i] = b[i] - b[i - 1];
  for (int i = 1; i <= n; i++) b[i] = c[i];
}
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])
      printf("SMALL\n0\n");
    else
      printf("IMPOSSIBLE\n");
    return 0;
  }
  if (n == 2) {
    long long cnt = 0;
    vector<pair<int, int> > ve;
    while (true) {
      if (b[1] == 0 || b[2] == 0) {
        printf("IMPOSSIBLE\n");
        return 0;
      }
      if (a[1] == b[1] && a[2] == b[2]) break;
      if (a[1] == b[2] && a[2] == b[1]) {
        ve.push_back(make_pair(1, 0));
        break;
      }
      if (b[1] == b[2]) {
        printf("IMPOSSIBLE\n");
        return 0;
      }
      if (b[1] > b[2]) {
        ve.push_back(make_pair(1, 0));
        swap(b[1], b[2]);
      }
      if (a[1] == b[1] && a[2] < b[2] && a[2] % b[1] == b[2] % b[1]) {
        cnt += (b[2] - a[2]) / b[1];
        ve.push_back(make_pair((b[2] - a[2]) / b[1], 1));
        break;
      }
      if (a[2] == b[1] && a[1] < b[2] && a[1] % b[1] == b[2] % b[1]) {
        cnt += (b[2] - a[1]) / b[1];
        ve.push_back(make_pair((b[2] - a[1]) / b[1], 1));
        ve.push_back(make_pair(1, 0));
        break;
      }
      cnt += b[2] / b[1];
      ve.push_back(make_pair(b[2] / b[1], 1));
      b[2] %= b[1];
    }
    if (cnt > 200000) {
      printf("BIG\n");
      printf("%lld\n", cnt);
    } else {
      printf("SMALL\n");
      long long ans = 0;
      for (int i = 0; i < ve.size(); i++) ans += ve[i].first;
      printf("%lld\n", ans);
      for (int i = ve.size() - 1; i >= 0; i--) {
        for (int j = 0; j < ve[i].first; j++) {
          if (ve[i].second)
            printf("P");
          else
            printf("R");
        }
      }
    }
    return 0;
  }
  vector<int> ve;
  long long cnt = 0;
  while (true) {
    if (check()) break;
    re();
    if (check()) {
      ve.push_back(0);
      break;
    }
    re();
    int x = 0, y = 0, z = 0;
    for (int i = 2; i <= n; i++) {
      if (b[i] > b[i - 1])
        x = 1;
      else if (b[i] < b[i - 1])
        y = 1;
      else
        z = 1;
    }
    if (z || (x && y)) {
      printf("IMPOSSIBLE\n");
      return 0;
    }
    if (y) {
      ve.push_back(0);
      re();
    }
    ve.push_back(1);
    rollback();
    cnt += 1;
  }
  if (cnt > 200000)
    printf("BIG\n%lld\n", cnt);
  else {
    int p = ve.size();
    printf("SMALL\n%d\n", p);
    for (int i = ve.size() - 1; i >= 0; i--)
      if (ve[i])
        printf("P");
      else
        printf("R");
  }
  return 0;
}
