#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000001;
const int MOD = 1000000007;
void print(vector<pair<char, long long>> ops) {
  reverse(ops.begin(), ops.end());
  long long n = 0;
  for (int i = (0); i <= ((int)((ops).size()) - 1); ++i) {
    if (ops[i].first == 'P') n += ops[i].second;
  }
  if (n > 200000) {
    cout << "BIG" << endl;
    cout << n << endl;
    return;
  }
  string ans = "";
  for (int i = (0); i <= ((int)((ops).size()) - 1); ++i) {
    for (int j = (0); j <= (ops[i].second - 1); ++j) ans += ops[i].first;
  }
  cout << "SMALL" << endl;
  cout << (int)((ans).size()) << endl;
  cout << ans << endl;
}
bool mon(vector<long long>& a) {
  for (int i = (1); i <= ((int)((a).size()) - 1); ++i)
    if (a[i] < a[i - 1]) return false;
  return true;
}
int main(int argc, const char* argv[]) {
  int n;
  cin >> n;
  vector<long long> a, b;
  a.resize(n);
  b.resize(n);
  for (int i = (0); i <= (n - 1); ++i) cin >> a[i];
  for (int i = (0); i <= (n - 1); ++i) cin >> b[i];
  vector<long long> ra = a;
  reverse(ra.begin(), ra.end());
  bool last_rev = false;
  vector<pair<char, long long>> ops;
  for (;;) {
    if (a == b) {
      print(ops);
      return 0;
    }
    if (b == ra) {
      ops.push_back(make_pair('R', 1));
      print(ops);
      return 0;
    }
    if (n == 1) break;
    long long sa = 0;
    for (int i = (0); i <= (n - 1); ++i) sa += a[i];
    long long sb = 0;
    for (int i = (0); i <= (n - 1); ++i) sb += b[i];
    if (sb < sa) break;
    if (mon(b)) {
      if (b[0] <= 0) break;
      if ((int)((b).size()) == 2 && b[1] / b[0] > 2 && (sb - sa) / b[0] > 2) {
        long long cnt = b[1] / b[0] - 1;
        cnt = min(cnt, (sb - sa) / b[0]) - 1;
        ops.push_back(make_pair('P', cnt));
        b[1] -= cnt * b[0];
      } else {
        vector<long long> tb;
        long long last = 0;
        for (int i = (0); i <= ((int)((b).size()) - 1); ++i) {
          tb.push_back(b[i] - last);
          last = b[i];
        }
        b = tb;
        ops.push_back(make_pair('P', 1));
      }
      last_rev = false;
    } else {
      if (last_rev) {
        break;
      }
      reverse(b.begin(), b.end());
      ops.push_back(make_pair('R', 1));
      last_rev = true;
    }
  }
  cout << "IMPOSSIBLE" << endl;
  return 0;
}
