#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
template <class T>
void Read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = 0;
  while (c < '0' || '9' < c) {
    if (c == '-') flag = 1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  if (flag) x = -x;
}
int gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
int main() {
  int n, m, t = 0;
  Read(n), Read(m);
  while (gcd(n, m) > 1) m /= gcd(n, m), ++t;
  if (m == 1)
    printf("2-type\n%d\n", t);
  else if (!t && n % m == 1)
    puts("3-type");
  else if (!t && n % m == m - 1)
    puts("11-type");
  else if ((n * n - 1) / ((n & 1) + 1) % m == 0)
    puts("6-type");
  else
    puts("7-type");
}
