#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n;
vector<long long> a, b;
string ans;
bool is_inc(vector<long long> a) {
  for (int i = 0; i < n - 1; i++)
    if (a[i] >= a[i + 1]) return 0;
  return 1;
}
bool is_dec(vector<long long> a) {
  for (int i = 0; i < n - 1; i++)
    if (a[i] <= a[i + 1]) return 0;
  return 1;
}
vector<long long> rev(vector<long long> a) {
  reverse(a.begin(), a.end());
  return a;
}
vector<long long> rollback(vector<long long> a) {
  for (int i = n - 1; i; i--) a[i] -= a[i - 1];
  return a;
}
void print(long long cnt) {
  reverse(ans.begin(), ans.end());
  if (cnt == -1) {
    cnt = 0;
    for (auto c : ans) cnt += (c == 'P');
  }
  if (cnt <= 2e5) {
    cout << "SMALL\n" << int(ans.size()) << '\n' << ans;
  } else {
    cout << "BIG\n" << cnt << '\n';
  }
  exit(0);
}
void No() {
  cout << "IMPOSSIBLE\n";
  exit(0);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  a.resize(n);
  b.resize(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[0] == b[0])
      print(-1);
    else
      No();
  } else if (n == 2) {
    long long cnt = 0;
    while (1) {
      if (a == b)
        print(cnt);
      else if (a == rev(b))
        ans += 'R', b = rev(b);
      else if (is_inc(b)) {
        if (cnt <= 2e5)
          ++cnt, ans += 'P', b = rollback(b);
        else if (a[0] <= a[1]) {
          if (b[1] >= a[1] && (b[1] - a[1]) % b[0] == 0 && a[0] == b[0]) {
            long long k = (b[1] - a[1]) / b[0];
            cnt += k;
            print(cnt);
          } else
            cnt += b[1] / b[0], b[1] %= b[0];
        } else {
          if (b[1] >= a[0] && (b[1] - a[0]) % b[0] == 0 && a[1] == b[0]) {
            long long k = (b[1] - a[0]) / b[0];
            cnt += k;
            print(cnt);
          } else
            cnt += b[1] / b[0], b[1] %= b[0];
        }
      } else if (is_dec(b))
        ans += 'R', b = rev(b);
      else
        No();
      if (!b[0] || !b[1]) No();
    }
  } else {
    while (1) {
      if (a == b)
        print(-1);
      else if (a == rev(b))
        ans += 'R', b = rev(b);
      else if (is_inc(b))
        ans += 'P', b = rollback(b);
      else if (is_dec(b))
        ans += 'R', b = rev(b);
      else
        No();
    }
  }
  return 0;
}
