#include <bits/stdc++.h>
using namespace std;
int n;
bool cmp(long long *a, long long *b) {
  for (int i = 0; i < n; i++) {
    if (a[i] != b[i]) return false;
  }
  return true;
}
bool check(long long *b) {
  for (int i = 1; i < n; i++) {
    if (b[i] <= b[i - 1]) return false;
  }
  return true;
}
int main() {
  scanf("%d", &n);
  long long a[200005];
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
  }
  long long b[200005];
  for (int i = 0; i < n; i++) {
    scanf("%lld", &b[i]);
  }
  if (n == 1) {
    if (a[0] == b[0])
      printf("SMALL\n0\n\n");
    else {
      printf("IMPOSSIBLE\n");
    }
    return 0;
  }
  if (n == 2) {
    long long tot = 0;
    long long sum = 0;
    vector<pair<long long, long long> > v;
    while (true) {
      if (b[0] == 0) {
        printf("IMPOSSIBLE\n");
        return 0;
      }
      if (b[0] == a[0] && b[1] == a[1]) {
        break;
      }
      if (b[0] == a[1] && b[1] == a[0]) {
        v.push_back(make_pair(1, 1));
        sum++;
        break;
      }
      if (b[0] > b[1]) {
        v.push_back(make_pair(1, 1));
        swap(b[0], b[1]);
        sum++;
        continue;
      }
      if (b[0] == a[0]) {
        if ((b[1] - a[1] >= 0) && (b[1] - a[1]) % b[0] == 0) {
          v.push_back(make_pair(0, (b[1] - a[1]) / b[0]));
          tot += (b[1] - a[1]) / b[0];
          sum += (b[1] - a[1]) / b[0];
          break;
        } else {
          v.push_back(make_pair(0, (b[1]) / b[0]));
          tot += (b[1]) / b[0];
          sum += b[1] / b[0];
          b[1] %= b[0];
          continue;
        }
      }
      if (b[0] == a[1]) {
        if ((b[1] - a[0]) >= 0 && (b[1] - a[0]) % b[0] == 0) {
          v.push_back(make_pair(0, (b[1] - a[0]) / b[0]));
          tot += (b[1] - a[0]) / b[0];
          sum += (b[1] - a[0]) / b[0];
          v.push_back(make_pair(1, 1));
          sum++;
          break;
        } else {
          v.push_back(make_pair(0, (b[1]) / b[0]));
          tot += (b[1]) / b[0];
          sum += b[1] / b[0];
          b[1] %= b[0];
          continue;
        }
      }
      v.push_back(make_pair(0, (b[1]) / b[0]));
      tot += (b[1]) / b[0];
      sum += b[1] / b[0];
      b[1] %= b[0];
    }
    if (tot > 200000) {
      printf("BIG\n%lld\n", tot);
    } else {
      printf("SMALL\n%lld\n", sum);
      reverse(v.begin(), v.end());
      for (auto it : v) {
        for (int i = 0; i < it.second; i++) {
          printf("%c", "PR"[it.first]);
        }
      }
      printf("\n");
    }
  } else {
    int tot = 0;
    vector<int> v;
    while (!cmp(a, b)) {
      if (!check(b)) {
        reverse(b, b + n);
        if (v.size() && v.back() == 1) {
          printf("IMPOSSIBLE\n");
          return 0;
        }
        v.push_back(1);
      } else {
        v.push_back(0);
        tot++;
        for (int i = n - 1; i >= 1; i--) b[i] -= b[i - 1];
      }
    }
    if (tot > 200000) {
      printf("BIG\n");
      printf("%d\n", tot);
    } else {
      printf("SMALL\n");
      printf("%d\n", v.size());
      reverse(v.begin(), v.end());
      for (auto it : v) {
        printf("%c", "PR"[it]);
      }
      printf("\n");
    }
  }
}
