#include <bits/stdc++.h>
using namespace std;
long long n, a[200005], b[200005], tmp[200005];
vector<int> ans, ans1, ans2;
string sol;
void f(bool flag) {
  if (ans.size() > 200000) {
    cout << "BIG\n";
    cout << ans.size() << "\n";
  } else {
    cout << "SMALL\n";
    reverse(ans.begin(), ans.end());
    for (int i = 0; i < ans.size(); i++) {
      if (ans[i] == 0)
        sol.push_back('P');
      else {
        sol.push_back('R');
        sol.push_back('P');
        sol.push_back('R');
      }
    }
    if (flag) sol.push_back('R');
    cout << sol.size() << "\n";
    cout << sol << "\n";
  }
  exit(0);
}
bool g() {
  for (int i = 0; i < n; i++) {
    if (tmp[i] <= 0) return false;
  }
  for (int i = 0; i < n; i++) {
    if (tmp[i] != a[i]) return true;
  }
  return false;
}
bool cre() {
  for (int i = 0; i < (n - 1); i++) {
    if (tmp[i] > tmp[i + 1]) return false;
  }
  return true;
}
void fcre() {
  long long curr = tmp[0];
  for (int i = 1; i < n; i++) {
    tmp[i] -= curr;
    curr += tmp[i];
  }
}
void fdec() {
  long long curr = tmp[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    tmp[i] -= curr;
    curr += tmp[i];
  }
}
void check() {
  int cont = 0;
  bool ok = true;
  ans.clear();
  while (g()) {
    if (cre()) {
      fcre();
      ans.push_back(0);
    } else {
      fdec();
      ans.push_back(1);
    }
  }
  for (int i = 0; i < n; i++) {
    if (a[i] != tmp[i]) ok = false;
  }
  if (ok == false) {
    ans.clear();
    ans.push_back(3);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    tmp[i] = b[i];
  }
  if (n == 1) {
    if (a[0] == b[0])
      cout << "SMALL\n0\n\n";
    else
      cout << "IMPOSSIBLE\n";
    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[0] == b[0] && a[1] == b[1]) 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";
      int flex = 0;
      for (auto i : res) flex += i.first;
      cout << flex << "\n";
      for (int i = res.size() - 1; i >= 0; --i) {
        for (int j = 0; j < res[i].first; ++j) {
          if (res[i].second)
            cout << "P";
          else
            cout << "R";
        }
      }
    }
    return 0;
  }
  check();
  ans1 = ans;
  reverse(b, b + n);
  for (int i = 0; i < n; i++) {
    tmp[i] = b[i];
  }
  check();
  ans2 = ans;
  if ((ans1.size() == 1 && ans1[0] == 3) && (ans2.size() == 1 && ans2[0] == 3))
    cout << "IMPOSSIBLE\n";
  else {
    if ((ans1.size() < ans2.size() && !(ans1.size() == 1 && ans1[0] == 3)) ||
        (ans2.size() == 1 && ans2[0] == 3)) {
      ans = ans1;
      f(0);
    } else {
      ans = ans2;
      f(1);
    }
  }
  return 0;
}
