#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  vector<long long> a(n), b(n);
  for (long long i = 0; i < n; ++i) cin >> a[i];
  for (long long i = 0; i < n; ++i) cin >> b[i];
  if (n == 1) {
    if (a[0] == b[0])
      cout << "SMALL\n" << 0;
    else
      cout << "IMPOSSIBLE";
    return 0;
  }
  if (n == 2) {
    vector<pair<long long, bool>> res;
    long long kol = 0;
    while (true) {
      if (b[0] == 0 || b[1] == 0) {
        cout << "IMPOSSIBLE";
        return 0;
      }
      if (a == b) break;
      if (a[0] == b[1] && a[1] == b[0]) {
        res.emplace_back(1, false);
        break;
      }
      if (b[0] == b[1]) {
        cout << "IMPOSSIBLE";
        return 0;
      }
      if (b[0] > b[1]) {
        res.emplace_back(1, false);
        swap(b[0], b[1]);
      }
      if (a[0] == b[0] && a[1] < b[1] && a[1] % b[0] == b[1] % b[0]) {
        res.emplace_back((b[1] - a[1]) / b[0], true);
        kol += res.back().first;
        break;
      }
      if (a[1] == b[0] && a[0] < b[1] && a[0] % b[0] == b[1] % b[0]) {
        res.emplace_back((b[1] - a[0]) / b[0], true);
        kol += res.back().first;
        res.emplace_back(1, false);
        break;
      }
      kol += b[1] / b[0];
      res.emplace_back(b[1] / b[0], true);
      b[1] %= b[0];
    }
    if (kol > 2e5) {
      cout << "BIG\n";
      cout << kol;
    } else {
      cout << "SMALL\n";
      long long flex = 0;
      for (auto i : res) flex += i.first;
      cout << flex << "\n";
      for (long long i = res.size() - 1; i >= 0; --i) {
        for (long long j = 0; j < res[i].first; ++j) {
          if (res[i].second)
            cout << "P";
          else
            cout << "R";
        }
      }
    }
    return 0;
  }
  vector<bool> ans;
  long long kol = 0;
  while (true) {
    if (a == b) break;
    reverse(b.begin(), b.end());
    if (a == b) {
      ans.push_back(false);
      break;
    }
    reverse(b.begin(), b.end());
    bool vozr = false, ub = false, r = false;
    for (long long i = 1; i < n; ++i) {
      if (b[i] > b[i - 1])
        vozr = true;
      else if (b[i] < b[i - 1])
        ub = true;
      else
        r = true;
    }
    if (r || (vozr && ub)) {
      cout << "IMPOSSIBLE";
      return 0;
    }
    vector<long long> c(n);
    if (ub) {
      ans.push_back(false);
      reverse(b.begin(), b.end());
    }
    c[0] = b[0];
    for (long long i = 1; i < n; ++i) {
      c[i] = b[i] - b[i - 1];
    }
    ans.push_back(true);
    b = c;
    ++kol;
  }
  if (kol > 2e5) {
    cout << "BIG\n" << kol;
  } else {
    cout << "SMALL\n" << ans.size() << "\n";
    for (long long i = ans.size() - 1; i >= 0; --i) {
      if (ans[i])
        cout << "P";
      else
        cout << "R";
    }
  }
}
