#include <bits/stdc++.h>
using namespace std;
int x[4];
char c[2];
int s;
int main() {
  for (int i = 1; i <= 3; i++) {
    cin >> c;
    if (c[0] == 'C' && c[1] != '#')
      x[i] = 1;
    else if (c[0] == 'C' && c[1] == '#')
      x[i] = 2;
    else if (c[0] == 'D' && c[1] != '#')
      x[i] = 3;
    else if (c[0] == 'D' && c[1] == '#')
      x[i] = 4;
    else if (c[0] == 'E' && c[1] != '#')
      x[i] = 5;
    else if (c[0] == 'F' && c[1] != '#')
      x[i] = 6;
    else if (c[0] == 'F' && c[1] == '#')
      x[i] = 7;
    else if (c[0] == 'G' && c[1] != '#')
      x[i] = 8;
    else if (c[0] == 'G' && c[1] == '#')
      x[i] = 9;
    else if (c[0] == 'A' && c[1] != '#')
      x[i] = 10;
    else if (c[0] == 'B' && c[1] != '#')
      x[i] = 11;
    else
      x[i] = 12;
  }
  sort(x + 1, x + 4);
  if (12 + (x[3] - x[2]) == 3 && 12 + (x[2] - x[1]) == 4 && x[1] > x[2] &&
      x[2] > x[3]) {
    cout << "major";
    return 0;
  } else if (x[3] - x[2] == 3 && x[2] - x[1] == 4 && x[1] < x[2] &&
             x[2] < x[3]) {
    cout << "major";
    return 0;
  } else if (12 + (x[3] - x[2]) == 3 && x[2] - x[1] == 4 && x[1] < x[2] &&
             x[2] > x[3]) {
    cout << "major";
    return 0;
  } else if (x[3] - x[2] == 3 && 12 + (x[2] - x[1]) == 4 && x[1] > x[2] &&
             x[2] < x[3]) {
    cout << "major";
    return 0;
  } else if (12 + (x[3] - x[2]) == 4 && 12 + (x[2] - x[1]) == 3 &&
             x[1] > x[2] && x[2] > x[3]) {
    cout << "minor";
    return 0;
  } else if (x[3] - x[2] == 4 && x[2] - x[1] == 3 && x[1] < x[2] &&
             x[2] < x[3]) {
    cout << "minor";
    return 0;
  } else if (12 + (x[3] - x[2]) == 4 && x[2] - x[1] == 3 && x[1] < x[2] &&
             x[2] > x[3]) {
    cout << "minor";
    return 0;
  } else if (x[3] - x[2] == 4 && 12 + (x[2] - x[1]) == 3 && x[1] > x[2] &&
             x[2] < x[3]) {
    cout << "minor";
    return 0;
  }
  s = x[2];
  x[2] = x[3];
  x[3] = s;
  if (12 + (x[3] - x[2]) == 3 && 12 + (x[2] - x[1]) == 4 && x[1] > x[2] &&
      x[2] > x[3]) {
    cout << "major";
    return 0;
  } else if (x[3] - x[2] == 3 && x[2] - x[1] == 4 && x[1] < x[2] &&
             x[2] < x[3]) {
    cout << "major";
    return 0;
  } else if (12 + (x[3] - x[2]) == 3 && x[2] - x[1] == 4 && x[1] < x[2] &&
             x[2] > x[3]) {
    cout << "major";
    return 0;
  } else if (x[3] - x[2] == 3 && 12 + (x[2] - x[1]) == 4 && x[1] > x[2] &&
             x[2] < x[3]) {
    cout << "major";
    return 0;
  } else if (12 + (x[3] - x[2]) == 4 && 12 + (x[2] - x[1]) == 3 &&
             x[1] > x[2] && x[2] > x[3]) {
    cout << "minor";
    return 0;
  } else if (x[3] - x[2] == 4 && x[2] - x[1] == 3 && x[1] < x[2] &&
             x[2] < x[3]) {
    cout << "minor";
    return 0;
  } else if (12 + (x[3] - x[2]) == 4 && x[2] - x[1] == 3 && x[1] < x[2] &&
             x[2] > x[3]) {
    cout << "minor";
    return 0;
  } else if (x[3] - x[2] == 4 && 12 + (x[2] - x[1]) == 3 && x[1] > x[2] &&
             x[2] < x[3]) {
    cout << "minor";
    return 0;
  }
  s = x[1];
  x[1] = x[2];
  x[2] = s;
  if (12 + (x[3] - x[2]) == 3 && 12 + (x[2] - x[1]) == 4 && x[1] > x[2] &&
      x[2] > x[3]) {
    cout << "major";
    return 0;
  } else if (x[3] - x[2] == 3 && x[2] - x[1] == 4 && x[1] < x[2] &&
             x[2] < x[3]) {
    cout << "major";
    return 0;
  } else if (12 + (x[3] - x[2]) == 3 && x[2] - x[1] == 4 && x[1] < x[2] &&
             x[2] > x[3]) {
    cout << "major";
    return 0;
  } else if (x[3] - x[2] == 3 && 12 + (x[2] - x[1]) == 4 && x[1] > x[2] &&
             x[2] < x[3]) {
    cout << "major";
    return 0;
  } else if (12 + (x[3] - x[2]) == 4 && 12 + (x[2] - x[1]) == 3 &&
             x[1] > x[2] && x[2] > x[3]) {
    cout << "minor";
    return 0;
  } else if (x[3] - x[2] == 4 && x[2] - x[1] == 3 && x[1] < x[2] &&
             x[2] < x[3]) {
    cout << "minor";
    return 0;
  } else if (12 + (x[3] - x[2]) == 4 && x[2] - x[1] == 3 && x[1] < x[2] &&
             x[2] > x[3]) {
    cout << "minor";
    return 0;
  } else if (x[3] - x[2] == 4 && 12 + (x[2] - x[1]) == 3 && x[1] > x[2] &&
             x[2] < x[3]) {
    cout << "minor";
    return 0;
  }
  s = x[2];
  x[2] = x[3];
  x[3] = s;
  if (12 + (x[3] - x[2]) == 3 && 12 + (x[2] - x[1]) == 4 && x[1] > x[2] &&
      x[2] > x[3]) {
    cout << "major";
    return 0;
  } else if (x[3] - x[2] == 3 && x[2] - x[1] == 4 && x[1] < x[2] &&
             x[2] < x[3]) {
    cout << "major";
    return 0;
  } else if (12 + (x[3] - x[2]) == 3 && x[2] - x[1] == 4 && x[1] < x[2] &&
             x[2] > x[3]) {
    cout << "major";
    return 0;
  } else if (x[3] - x[2] == 3 && 12 + (x[2] - x[1]) == 4 && x[1] > x[2] &&
             x[2] < x[3]) {
    cout << "major";
    return 0;
  } else if (12 + (x[3] - x[2]) == 4 && 12 + (x[2] - x[1]) == 3 &&
             x[1] > x[2] && x[2] > x[3]) {
    cout << "minor";
    return 0;
  } else if (x[3] - x[2] == 4 && x[2] - x[1] == 3 && x[1] < x[2] &&
             x[2] < x[3]) {
    cout << "minor";
    return 0;
  } else if (12 + (x[3] - x[2]) == 4 && x[2] - x[1] == 3 && x[1] < x[2] &&
             x[2] > x[3]) {
    cout << "minor";
    return 0;
  } else if (x[3] - x[2] == 4 && 12 + (x[2] - x[1]) == 3 && x[1] > x[2] &&
             x[2] < x[3]) {
    cout << "minor";
    return 0;
  }
  s = x[1];
  x[1] = x[2];
  x[2] = s;
  if (12 + (x[3] - x[2]) == 3 && 12 + (x[2] - x[1]) == 4 && x[1] > x[2] &&
      x[2] > x[3]) {
    cout << "major";
    return 0;
  } else if (x[3] - x[2] == 3 && x[2] - x[1] == 4 && x[1] < x[2] &&
             x[2] < x[3]) {
    cout << "major";
    return 0;
  } else if (12 + (x[3] - x[2]) == 3 && x[2] - x[1] == 4 && x[1] < x[2] &&
             x[2] > x[3]) {
    cout << "major";
    return 0;
  } else if (x[3] - x[2] == 3 && 12 + (x[2] - x[1]) == 4 && x[1] > x[2] &&
             x[2] < x[3]) {
    cout << "major";
    return 0;
  } else if (12 + (x[3] - x[2]) == 4 && 12 + (x[2] - x[1]) == 3 &&
             x[1] > x[2] && x[2] > x[3]) {
    cout << "minor";
    return 0;
  } else if (x[3] - x[2] == 4 && x[2] - x[1] == 3 && x[1] < x[2] &&
             x[2] < x[3]) {
    cout << "minor";
    return 0;
  } else if (12 + (x[3] - x[2]) == 4 && x[2] - x[1] == 3 && x[1] < x[2] &&
             x[2] > x[3]) {
    cout << "minor";
    return 0;
  } else if (x[3] - x[2] == 4 && 12 + (x[2] - x[1]) == 3 && x[1] > x[2] &&
             x[2] < x[3]) {
    cout << "minor";
    return 0;
  }
  s = x[2];
  x[2] = x[3];
  x[3] = s;
  if (12 + (x[3] - x[2]) == 3 && 12 + (x[2] - x[1]) == 4 && x[1] > x[2] &&
      x[2] > x[3]) {
    cout << "major";
    return 0;
  } else if (x[3] - x[2] == 3 && x[2] - x[1] == 4 && x[1] < x[2] &&
             x[2] < x[3]) {
    cout << "major";
    return 0;
  } else if (12 + (x[3] - x[2]) == 3 && x[2] - x[1] == 4 && x[1] < x[2] &&
             x[2] > x[3]) {
    cout << "major";
    return 0;
  } else if (x[3] - x[2] == 3 && 12 + (x[2] - x[1]) == 4 && x[1] > x[2] &&
             x[2] < x[3]) {
    cout << "major";
    return 0;
  } else if (12 + (x[3] - x[2]) == 4 && 12 + (x[2] - x[1]) == 3 &&
             x[1] > x[2] && x[2] > x[3]) {
    cout << "minor";
    return 0;
  } else if (x[3] - x[2] == 4 && x[2] - x[1] == 3 && x[1] < x[2] &&
             x[2] < x[3]) {
    cout << "minor";
    return 0;
  } else if (12 + (x[3] - x[2]) == 4 && x[2] - x[1] == 3 && x[1] < x[2] &&
             x[2] > x[3]) {
    cout << "minor";
    return 0;
  } else if (x[3] - x[2] == 4 && 12 + (x[2] - x[1]) == 3 && x[1] > x[2] &&
             x[2] < x[3]) {
    cout << "minor";
    return 0;
  }
  cout << "strange";
  return 0;
}
