Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	io := NewIo()
	defer io.Flush()
	for {
		s := io.NextLine()
		if s == "." {
			break
		}
		t := io.NextLine()
		if s == t {
			io.Println("IDENTICAL")
			continue
		}
		ss := strings.Split(s, "\"")
		tt := strings.Split(t, "\"")
		if len(ss) != len(tt) {
			io.Println("DIFFERENT")
			continue
		}
		cnt := 0
		for i := 0; i < len(ss); i++ {
			if i%2 == 0 {
				if ss[i] != tt[i] {
					cnt = -1
					break
				}
			} else {
				if ss[i] != tt[i] {
					cnt++
				}
			}
		}
		if cnt > 1 || cnt == -1 {
			io.Println("DIFFERENT")
		} else {
			io.Println("CLOSE")
		}
	}
}

// I/O template
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func NewIo() *Io {
	return &Io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *Io) NextLine() string {
	var buff []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buff = append(buff, line...)
		if !isPrefix {
			break
		}
	}
	return string(buff)
}

func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	s := io.tokens[io.nextToken]
	io.nextToken++
	return s
}

func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *Io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func (io *Io) PrintIntSlice(a []int) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func (io *Io) PrintStringSlice(a []string) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func Log(name string, value interface{}) {
	fmt.Fprintf(os.Stderr, "%s=%+v\n", name, value)
}

func ExampleIo() {
	io := NewIo()
	defer io.Flush()
	a := make([]int, 0, 3)
	a[0], a[1], a[2] = io.NextInt(), io.NextInt(), io.NextInt()
	io.Println(a)
	io.PrintIntSlice(a)
	Log("io", a)
}

C++: #include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;

#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble

typedef tuple<int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;

int IT_MAX = 1 << 18;
const ll MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const db PI = acos(-1);
const db ERR = 1e-9;
#define szz(x) (int)(x).size()
#define rep(i, n) for(int i=0;i<n;i++)
#define Se second
#define Fi first

char in1[1050];
char in2[1050];
bool chk[1050];
int main() {
	while (1) {
		scanf("%s", in1);
		if (in1[0] == '.') break;
		scanf("%s", in2);

		if (strcmp(in1, in2) == 0) {
			printf("IDENTICAL\n");
			continue;
		}

		int L1 = strlen(in1), L2 = strlen(in2);
		int c1 = 0, c2 = 0, i, prv = -1;
		for (i = 0; i < L1 && i < L2; i++) {
			if (in1[i] != in2[i]) break;
			if (in1[i] == '"') prv = i;
		}
		c1 = prv+1;
		if (i >= L1 || i >= L2) {
			printf("DIFFERENT\n");
			continue;
		}

		int c = 0;
		for (i = 0; i < c1; i++) if (in1[i] == '"') c++;
		if (c % 2 == 0) {
			printf("DIFFERENT\n");
			continue;
		}

		int p1 = 0, p2 = 0;
		for (p1 = c1; p1 < L1; p1++) if (in1[p1] == '"') break;
		for (p2 = c1; p2 < L2; p2++) if (in2[p2] == '"') break;

		if (p1 == L1 || p2 == L2 || L1-p1 != L2-p2) {
			printf("DIFFERENT\n");
			continue;
		}
		for (i = 1; i < L1 - p1; i++) if (in1[i + p1] != in2[i + p2]) break;
		if (i >= L1 - p1) printf("CLOSE\n");
		else printf("DIFFERENT\n");
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>

using namespace std;
typedef long long ll;

void split(string &s, vector<string> &v) {
	s += '"';
	string buf;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == '"') {
			v.push_back(buf);
			buf.clear();
		}
		else buf += s[i];
	}
}

int main() {

	while (1) {
		string S1, S2;
		cin >> S1;
		if (S1 == ".")break;
		cin >> S2;
		//すでに完全に一致ならば
		if (S1 == S2) {
			cout << "IDENTICAL" << endl;
			continue;
		}
		vector<string> v1, v2;
		split(S1, v1), split(S2, v2);

		if (v1.size() != v2.size()) {
			cout << "DIFFERENT" << endl;
			continue;
		}
		
		int cnt = 0;
		for (int i = 0; i < v1.size(); i++) {
			if (i % 2 == 1) {
				if (v1[i] != v2[i])cnt++;
			}
			else {
				if (v1[i] != v2[i]) {
					cout << "DIFFERENT" << endl;
					continue;
				}
			}
		}
		if (cnt <= 1) {
			cout << "CLOSE" << endl;
		}
		else {
			cout << "DIFFERENT" << endl;
		}
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

typedef int_fast32_t int32;
typedef int_fast64_t int64;

const int32 inf = 1e9+7;
const int32 MOD = 1000000007;
const int64 llinf = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE\n" : "IMPOSSIBLE\n"  )
#define ANS(n) cout << (n) << endl
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define all(obj) (obj).begin(),(obj).end()
#define rall(obj) (obj).rbegin(),(obj).rend()
#define fi first
#define se second
#define pb(a) push_back(a)
typedef pair<int32,int32> pii;
typedef pair<int64,int64> pll;

template<class T> inline bool chmax(T& a, T b) {
  if (a < b) { a = b; return true; } return false;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) { a = b; return true; } return false;
}

void solve(string s, string t){
  int32 n = s.size();
  int32 m = t.size();
  bool flg = false;
  int32 cnt = 0;
  string a,b;
  a=b="";
  int32 i=0,j=0;
  while(i<n&&j<m){
    if(flg){
      while(s[i] != '\"'){
        a.pb(s[i]);
        ++i;
      }
      while(t[j] != '\"'){
        b.pb(t[j]);
        ++j;
      }
      if(a != b)++cnt;
      a=b="";
      flg= false;
    }else{
      if(s[i] == '\"' && t[j] == '\"'){
        flg = true;
      }else if(s[i] != t[j]){
        ANS("DIFFERENT");
        return;
      }
    }
    ++i;++j;
  }
  if(cnt >= 2 || i != n || j != m){
    ANS("DIFFERENT");
  }else if(cnt == 1){
    ANS("CLOSE");
  }else{
    ANS("IDENTICAL");
  }
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s,t;
  while(true){
    cin >> s;
    if(s == ".")return 0;
    cin >> t;
    solve(s,t);
  }
  return 0;
}

C++: #include<iostream>
#include<string>
#include<utility>

using namespace std;

int main(){

  char s1[200]={0};
  char s2[200]={};
  int c;
  cin>>s1>>s2;
 
  
  for(int i=0;i<200;i++){
    if(s1[i]!=s2[i]){
      c++;
    }
  }
    if(c==0){
      cout<<"IDENTICAL"<<endl;
    }else if(c==1){
      cout<<"CLOSE"<<endl;
    }else{
      cout<<"DIFFERENT"<<endl;
    }

return 0;
}