#include <bits/stdc++.h>
using namespace std;
int cansel_sync = (ios::sync_with_stdio(0), cin.tie(0), 0);
const int N = 500010;
long long n, cnt;
vector<long long> a, b;
deque<char> ans;
void rev() {
  reverse(b.begin(), b.end());
  ans.push_front('R');
}
long long ok() {
  if (a == b) return 1;
  for (long long i = (0), _ = (n); i < _; i++)
    if (a[i] != b[n - i - 1]) return 0;
  ans.push_front('R');
  return 1;
}
long long down() {
  if (ok()) return 1;
  if (b[0] > b[1]) rev();
  for (long long i = (0), _ = (n - 1); i < _; i++)
    if (b[i] >= b[i + 1]) return -1;
  for (long long i = (n)-1, _ = (1); i >= _; i--) b[i] -= b[i - 1];
  ans.push_front('P');
  cnt++;
  return 0;
}
void push(long long x) {
  cnt += x;
  b[1] -= b[0] * x;
  while (x--) {
    if (ans.size() > N) return;
    ans.push_front('P');
  }
}
long long down2() {
  if (ok()) return 1;
  if (b[0] > b[1]) rev();
  if (a[0] > b[0] || a[1] > b[1]) return -1;
  long long t = max((b[1] - a[1]) / b[0], 1ll);
  push(t);
  return 0;
}
void output(long long ok) {
  if (ok) {
    if (cnt <= 200000) {
      cout << "SMALL" << endl << ans.size() << endl;
      for (auto i : ans) cout << i;
      cout << endl;
    } else
      cout << "BIG" << endl << cnt << endl;
  } else
    cout << "IMPOSSIBLE" << endl;
}
signed main() {
  cin >> n;
  a = b = vector<long long>(n);
  for (long long i = (0), _ = (n); i < _; i++) cin >> a[i];
  for (long long i = (0), _ = (n); i < _; i++) cin >> b[i];
  if (n == 1)
    output(a[0] == b[0]);
  else if (n == 2) {
    long long flag = 0;
    if (a[0] > a[1]) {
      swap(a[0], a[1]);
      flag = 1;
    }
    long long t;
    do t = down2();
    while (t == 0);
    if (flag) ans.push_front('R');
    output(t == 1);
  } else {
    long long t;
    do t = down();
    while (t == 0);
    output(t == 1);
  }
  return 0;
}
