/*
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main() {
int n,front, rear;
double *queue,mul,mulmax = 1, fullmax = 0, value1 = 1, value2 = 1;
scanf("%d",&n);
queue = (double*)malloc(sizeof(double) * n);
front = 0;
rear = n-1;
for(int i = 0; i < n; i++) {
scanf("%lf",&queue[i]);
}
for(int i = front; i <= rear; i++) {
value2 *= queue[i];
//printf("1");
if(i > 0) {
for(int j = i-1; j >= 0; j--) {
value1 *= queue[j];
if(mulmax < value1) {
mulmax = value1;
}
}
value2 *= mulmax;
value1 = 1;
mulmax = 1;
}
else if(i < n-1) {
for(int j = i+1; j < n; j++) {
value1 *= queue[j];
if(mulmax < value1) {
mulmax = value1;
}
}
value2 *= mulmax;
value1 = 1;
mulmax = 1;
}
if(value2 > fullmax) {
fullmax = value2;
}
value2 = 1;
}
printf("%.3lf",round(fullmax*1000)/1000);
}
*/
/*
#include<stdio.h>
int main() {
int n;
scanf("%d",&n);
}
*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main() {
int check[2];
char str[151], front = 0;
scanf("%s",str);
while(front < strlen(str)-1) {
if(str[front] == '0') {
if(str[front+1] == '1') {
front+=2;
}
else {
printf("1 %d", front);
printf("NOISE");
return 0;
}
}
else {
if(strlen(str)-1-front >= 2 && str[front+1] == '0' && str[front+2] == '0') {
while(1) {
front++;
if(str[front] == '1') {
while(front < strlen(str)-1) {
front++;
if(str[front] == '0') {
break;
}
}
break;
}
if(front == strlen(str)-1) {
printf("2 %d", front);
printf("NOISE");
return 0;
}
}
}
else {
printf("3 %d", front);
printf("NOISE");
return 0;
}
}
}
printf("SUBMARINE");
return 0;
}