#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long n;
  cin >> n;
  vector<long long> a(n), s(n);
  for (long long q = 0; q < n; q++) {
    cin >> a[q];
  }
  for (long long q = 0; q < n; q++) {
    cin >> s[q];
  }
  if (n == 1) {
    if (a[0] != s[0]) {
      cout << "IMPOSSIBLE" << '\n';
    } else {
      cout << "SMALL" << '\n' << 0 << '\n';
    }
    return 0;
  }
  string t;
  long long quantity = 0;
  while (quantity < 2000001) {
    if (a == s) {
      if (quantity > 200000) {
        cout << "BIG" << '\n' << quantity << '\n';
      } else {
        cout << "SMALL" << '\n' << t.size() << '\n';
        reverse(t.begin(), t.end());
        cout << t << '\n';
      }
      break;
    }
    reverse(s.begin(), s.end());
    if (a == s) {
      t += 'R';
      if (quantity > 200000) {
        cout << "BIG" << '\n' << quantity << '\n';
      } else {
        cout << "SMALL" << '\n' << t.size() << '\n';
        reverse(t.begin(), t.end());
        cout << t << '\n';
      }
      break;
    }
    reverse(s.begin(), s.end());
    bool flag = true, flag1 = true;
    for (long long q = 1; q < n; q++) {
      if (s[q - 1] >= s[q]) {
        flag = false;
      }
      if (s[q - 1] <= s[q]) {
        flag1 = false;
      }
    }
    if (!flag && !flag1) {
      cout << "IMPOSSIBLE" << '\n';
      break;
    }
    if (flag1) {
      t += 'R';
      reverse(s.begin(), s.end());
    }
    vector<long long> s1 = {s[0]};
    for (long long q = 1; q < n; q++) {
      s1.push_back(s[q] - s[q - 1]);
    }
    s = s1, t += 'P', quantity++;
  }
  if (quantity == 2000001) {
    if (a[1] < a[0]) {
      swap(a[0], a[1]);
    }
    while (s[0] > a[0]) {
      quantity += s[1] / s[0];
      swap(s[0], s[1]);
      s[0] %= s[1];
    }
    if (s[0] < a[0] || (s[0] == a[0] && (s[1] - a[1]) % s[0] != 0)) {
      cout << "IMPOSSIBLE" << '\n';
    } else {
      cout << "BIG" << '\n' << quantity + (s[1] - a[1]) / s[0] << '\n';
    }
  }
  return 0;
}
