#include <bits/stdc++.h>
using namespace std;
const int N = 3e6 + 6;
bool isup(vector<long long>& a) {
  for (int i = (1); i < (int(a.size())); ++i)
    if (a[i] <= a[i - 1]) return 0;
  return 1;
}
bool isdown(vector<long long>& a) {
  for (int i = (1); i < (int(a.size())); ++i)
    if (a[i] >= a[i - 1]) return 0;
  return 1;
}
void rev(vector<long long>& a) { reverse(a.begin(), a.end()); }
void rollback(vector<long long>& a) {
  vector<long long> rt = a;
  for (int i = (1); i < (int(a.size())); ++i) rt[i] = a[i] - a[i - 1];
  a = rt;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(20);
  int n;
  cin >> n;
  vector<long long> a(n), b(n);
  for (int i = (0); i < (n); ++i) cin >> a[i];
  for (int i = (0); i < (n); ++i) cin >> b[i];
  if (n == 1) {
    if (a == b)
      cout << "SMALL\n0";
    else
      cout << "IMPOSSIBLE";
    return 0;
  }
  if (n == 2) {
    bool r = 0;
    string rs;
    if (isdown(a)) {
      r = 1;
      rev(a);
    }
    if (isdown(b)) {
      rev(b);
      rs += "R";
    }
    long long cn = 0;
    while (true) {
      if (b[0] < a[0]) {
        cout << "IMPOSSIBLE";
        return 0;
      }
      if (a == b) break;
      if (a[0] == b[0]) {
        if (b[1] >= a[1] && (b[1] - a[1]) % b[0] == 0) {
          cn += (b[1] - a[1]) / b[0];
          if (cn <= 2e5)
            for (int i = (0); i < ((b[1] - a[1]) / b[0]); ++i) rs += "P";
          break;
        } else {
          cout << "IMPOSSIBLE";
          return 0;
        }
      } else {
        long long c = (b[1] - 1) / b[0];
        cn += c;
        if (cn <= 2e5)
          for (int i = (0); i < (c); ++i) rs += "P";
        b[1] %= b[0];
        rev(b);
        rs += "R";
      }
    }
    if (r) rs += "R";
    if (cn <= 2e5) {
      reverse(rs.begin(), rs.end());
      cout << "SMALL\n" << int(rs.size()) << '\n' << rs;
    } else {
      cout << "BIG\n" << cn;
    }
  } else {
    string rs;
    int cn = 0;
    while (true) {
      if (a == b) break;
      rev(a);
      if (a == b) {
        rs += "R";
        break;
      }
      rev(a);
      if (isup(b)) {
        rs += "P";
        cn++;
        rollback(b);
      } else if (isdown(b)) {
        rs += "R";
        rev(b);
      } else {
        cout << "IMPOSSIBLE";
        return 0;
      }
    }
    if (cn <= 2e5) {
      reverse(rs.begin(), rs.end());
      cout << "SMALL\n" << int(rs.size()) << '\n' << rs;
    } else {
      cout << "BIG\n" << cn;
    }
  }
}
