#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
int n;
long long a[N + 5], b[N + 5], cntp;
string res;
void out(bool x) {
  if (!x)
    puts("IMPOSSIBLE");
  else {
    if (cntp > N) {
      puts("BIG");
      printf("%lld\n", cntp);
    } else {
      puts("SMALL");
      reverse(res.begin(), res.end());
      printf("%d\n%s\n", (int)res.size(), res.c_str());
    }
  }
}
bool ok() {
  bool sm = 1;
  for (int i = (1); i <= (n); ++i) {
    sm &= (a[i] == b[i]);
  }
  if (sm) return 1;
  sm = 1;
  for (int i = (1); i <= (n); ++i) {
    sm &= (a[i] == b[n + 1 - i]);
  }
  if (sm) {
    if (cntp <= N) {
      res += 'R';
    }
    return 1;
  }
  return 0;
}
bool solve2() {
  long long x = min(a[1], a[2]), y = max(a[1], a[2]);
  while (1) {
    if (ok()) return 1;
    if (b[1] < b[2]) {
      long long t = 0;
      if (b[1] < x) {
        return 0;
      } else if (b[1] == x) {
        t = (b[2] - y) / b[1];
      } else {
        t = (b[2] - 1) / b[1];
      }
      if (t <= 0) {
        return 0;
      } else {
        b[2] -= t * b[1];
        if ((cntp += t) <= N) {
          res += string(t, 'P');
        }
      }
    } else if (b[1] > b[2]) {
      swap(b[1], b[2]);
      if (cntp <= N) {
        res += 'R';
      }
    } else {
      return 0;
    }
  }
}
bool solve3() {
  while (1) {
    if (ok()) return 1;
    bool u = 1, d = 1;
    for (int i = (1); i <= (n - 1); ++i) {
      u &= (b[i] < b[i + 1]);
      d &= (b[i] > b[i + 1]);
    }
    if (u) {
      for (int i = (n); i >= (2); --i) {
        b[i] -= b[i - 1];
      }
      if ((++cntp) <= N) {
        res += 'P';
      }
    } else if (d) {
      reverse(b + 1, b + n + 1);
      if (cntp <= N) {
        res += 'R';
      }
    } else {
      return 0;
    }
  }
}
int main() {
  scanf("%d", &(n));
  for (int i = (1); i <= (n); ++i) scanf("%lld", &a[i]);
  for (int i = (1); i <= (n); ++i) scanf("%lld", &b[i]);
  if (n == 1)
    out(a[1] == b[1]);
  else if (n == 2)
    out(solve2());
  else
    out(solve3());
  return 0;
}
