#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int mod = 1000000007;
const long long linf = 0x3f3f3f3f3f3f3f3f;
long long a[200100];
long long b[200100];
string ans;
vector<long long> res;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
  for (int i = 0; i < n; i++) scanf("%lld", &b[i]);
  if (n == 1) {
    if (a[0] == b[0]) {
      printf("SMALL\n");
      printf("0\n");
    } else
      printf("IMPOSSIBLE\n");
    return 0;
  }
  if (n >= 3) {
    bool ok = false;
    int small = 0;
    while (true) {
      bool aux = true, aux1 = true;
      for (int i = 0; i < n; i++) {
        if (a[i] != b[i]) aux = false;
        if (a[n - 1 - i] != b[i]) aux1 = false;
      }
      if (aux) {
        ok = true;
        break;
      } else if (aux1) {
        ans.push_back('R');
        ok = true;
        break;
      }
      aux = true, aux1 = true;
      for (int i = 0; i < n - 1; i++) {
        if (b[i] >= b[i + 1]) aux = false;
        if (b[i] <= b[i + 1]) aux1 = false;
      }
      if (aux) {
        for (int i = n - 1; i >= 1; i--) b[i] = (b[i] - b[i - 1]);
        ans.push_back('P');
        small++;
      } else if (aux1) {
        reverse(b, b + n);
        ans.push_back('R');
      } else
        break;
    }
    if (!ok) return 0 * printf("IMPOSSIBLE\n");
    reverse(ans.begin(), ans.end());
    if (small <= 200000) {
      printf("SMALL\n");
      printf("%d\n", ans.size());
      for (int i = 0; i < ans.size(); i++) printf("%c", ans[i]);
      printf("\n");
    } else {
      printf("BIG\n");
      printf("%d\n", small);
    }
    return 0;
  }
  bool ok = false;
  if (a[0] > a[1]) ok = true, swap(a[0], a[1]);
  if (b[0] > b[1])
    res.push_back(1), swap(b[0], b[1]);
  else
    res.push_back(0);
  bool aux = true;
  long long small = 0;
  while (true) {
    if (b[0] < a[0]) {
      aux = false;
      break;
    }
    if (b[0] == a[0]) {
      if ((b[1] - a[1]) % a[0] == 0) {
        res.push_back((b[1] - a[1]) / a[0]);
        small += (b[1] - a[1]) / a[0];
      } else
        aux = false;
      break;
    }
    res.push_back(b[1] / b[0]);
    small += b[1] / b[0];
    res.push_back(1);
    b[1] = b[1] % b[0];
    swap(b[1], b[0]);
  }
  if (!aux)
    printf("IMPOSSIBLE\n");
  else {
    if (small <= 200000) {
      printf("SMALL\n");
      for (int i = 0; i < res.size(); i += 2) {
        for (int j = 0; j < res[i]; j++) ans.push_back('R');
        for (int j = 0; j < res[i + 1]; j++) ans.push_back('P');
      }
      if (ok) ans.push_back('R');
      reverse(ans.begin(), ans.end());
      printf("%d\n", ans.size());
      for (int i = 0; i < ans.size(); i++) printf("%c", ans[i]);
      printf("\n");
    } else {
      printf("BIG\n");
      printf("%lld\n", small);
    }
  }
  return 0;
}
