#include<stdio.h>
int main(void) {
	char s1[200], s2[200];
	int i=0,cnt,jud;
	while (1) {
		cnt = 0;
		jud = 0;
		i = 0;
		scanf("%s",s1);
		scanf("%s",s2);
		if (s1[0] == '.') {
			break;
		}
		while (s1[i] != EOF) {
			if ((s1[i] != s2[i]) && (jud == 0)) {
				cnt++;
				jud = 1;
			}
			if (s1[i] == ';') {
				cnt = 0;
			}
		}
	}
	if (cnt == 0) {
		printf("IDENTICAL\n");
	}
	else if(cnt==1){
		printf("CLOSE\n");
	}else{
		printf("DIFFERENT\n");
	}
	return 0;
}
