#include <bits/stdc++.h>
using namespace std;
bool strictlyIncreasing(vector<long long>& a) {
  for (int i = 1; i < ((int)(a).size()); ++i) {
    if (a[i] <= a[i - 1]) {
      return false;
    }
  }
  return true;
}
bool striclyDecreasing(vector<long long>& a) {
  for (int i = 1; i < ((int)(a).size()); ++i) {
    if (a[i] >= a[i - 1]) {
      return false;
    }
  }
  return true;
}
void rollback(vector<long long>& a) {
  long long tot = 0;
  for (int i = 0; i < ((int)(a).size()); ++i) {
    a[i] -= tot;
    tot += a[i];
  }
}
bool equal(vector<long long>& a, vector<long long>& b) {
  for (int i = 0; i < ((int)(a).size()); ++i) {
    if (a[i] != b[i]) {
      return false;
    }
  }
  return true;
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  int n;
  cin >> n;
  vector<long long> a(n), b(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  for (int i = 0; i < (n); ++i) cin >> b[i];
  if (n == 1) {
    if (equal(a, b)) {
      cout << "SMALL" << endl;
      cout << 0 << endl;
      cout << endl;
    } else {
      cout << "IMPOSSIBLE" << endl;
    }
    return 0;
  } else if (n == 2) {
    vector<long long> rollbacksInARow;
    bool reverseAtStart = a[1] < a[0];
    sort(begin(a), end(a));
    while (!equal(a, b)) {
      if (b[1] < b[0]) {
        reverse(begin(b), end(b));
        rollbacksInARow.push_back(0);
      } else if (b[0] == b[1]) {
        cout << "IMPOSSIBLE" << endl;
        return 0;
      } else if (a[0] == b[0]) {
        if (b[1] < a[1] || (b[1] - a[1]) % a[0] != 0) {
          cout << "IMPOSSIBLE" << endl;
          return 0;
        }
        rollbacksInARow.push_back((b[1] - a[1]) / a[0]);
        break;
      } else {
        rollbacksInARow.push_back(b[1] / b[0]);
        if (b[1] % b[0] == 0) {
          rollbacksInARow[(int)(rollbacksInARow).size() - 1] -= 1;
        }
        b[1] -= b[0] * rollbacksInARow[(int)(rollbacksInARow).size() - 1];
      }
    }
    if (reverseAtStart) {
      rollbacksInARow.push_back(0);
    }
    reverse(begin(rollbacksInARow), end(rollbacksInARow));
    long long ops = 0;
    for (auto& elem : rollbacksInARow) {
      ops += elem;
    }
    if (ops > 200000) {
      cout << "BIG" << endl;
      cout << ops << endl;
    } else {
      for (auto& elem : rollbacksInARow)
        if (elem == 0) {
          ops++;
        }
      cout << "SMALL" << endl;
      cout << ops << endl;
      for (auto& elem : rollbacksInARow) {
        if (elem == 0) {
          cout << 'R';
        } else {
          while (elem--) {
            cout << 'P';
          }
        }
      }
      cout << endl;
    }
    return 0;
  }
  vector<char> ansString;
  int ops = 0;
  while (!equal(a, b)) {
    reverse(begin(b), end(b));
    if (equal(a, b)) {
      ansString.push_back('R');
      break;
    } else {
      reverse(begin(b), end(b));
    }
    if (strictlyIncreasing(b)) {
      rollback(b);
      ansString.push_back('P');
      ops++;
    } else if (striclyDecreasing(b)) {
      reverse(begin(b), end(b));
      ansString.push_back('R');
    } else {
      cout << "IMPOSSIBLE" << endl;
      return 0;
    }
  }
  if (ops > 200000) {
    cout << "BIG" << endl;
    cout << ops << endl;
  } else {
    for (auto& elem : ansString)
      if (elem == 'R') {
        ops++;
      }
    cout << "SMALL" << endl;
    cout << ops << endl;
    reverse(begin(ansString), end(ansString));
    for (auto& c : ansString) cout << c;
    cout << endl;
  }
}
