#include<stdio.h>
int main(void) {
	char s1[300], s2[300];
	int i = 0, cnt, jud,j;
	while (1) {
		cnt = 0;
		jud = 0;
		i = 0;
		j = 0;
		fgets(s1,sizeof(s1),stdin);
		//scanf("%s",s1);
		if (s1[0] == '.') {
			break;
		}
		fgets(s2,sizeof(s2),stdin);
		//scanf("%s",s2);
		while (s1[i] != '\0'||s2[j:!='\0']) {
			printf("%c %c\n", s1[i], s2[j]);
			if (s1[i] != s2[j]) {
				if (jud == 0) {
					cnt = 2;
					break;
				}
				else {
					cnt++;
					if (s2[j] != '"') {
						do {
							j++;
						} while (s2[j] != '"');
					}
					if (s1[i] != '"') {
						do {
							i++;
						} while (s1[i] != '"');
					}
					jud = 0;
				}
			}
			if (s1[i] == '"') {
				jud = 1;
			}
			i++;
			j++;
		}
		if (cnt == 0) {
			printf("IDENTICAL\n");
		}
		else if (cnt == 1) {
			printf("CLOSE\n");
		}
		else {
			printf("DIFFERENT\n");
		}
	}
	return 0;
}
