Problem:


Almost Identical Programs

The programming contest named
Concours de Programmation Comtemporaine Interuniversitaire (CPCI)
has a judging system similar to that of ICPC;
contestants have to submit correct outputs for two different inputs
to be accepted as a correct solution.

Each of the submissions should include the program that generated
the output.  A pair of submissions is judged to be a correct
solution when, in addition to the correctness of the outputs, they
include an identical program.

Many contestants, however, do not stop including a different version
of their programs in their second submissions, after modifying a
single string literal in their programs representing 
the input file name, attempting to process different input.

The organizers of CPCI are exploring the possibility of showing a
special error message for such close submissions, 
indicating contestants what's wrong with such submissions.

Your task is to detect such close submissions.

Input

The input consists of at most 100 datasets, each in the following format.

s1
s2

Each of s1 and s2 is
a string written in a line, with the length between 1 and 200, inclusive.
They are the first and the second submitted programs respectively.

A program consists of lowercase letters (a, b, ..., z), uppercase letters (A, B, ..., Z),
digits (0, 1, ..., 9), double quotes ("), and semicolons (;).
When double quotes occur in a program, there are always even number of them.

The end of the input is indicated by a line containing one '.' (period).

Output

For each dataset, print the judge result in a line.

If the given two programs are identical, print IDENTICAL.
If two programs differ with only one corresponding string literal, print CLOSE.
Otherwise, print DIFFERENT.

A string literal is a possibly empty sequence of characters between an
odd-numbered occurrence of a double quote and the next occurrence of
a double quote.

Sample Input

print"hello";print123
print"hello";print123
read"B1input";solve;output;
read"B2";solve;output;
read"C1";solve;output"C1ans";
read"C2";solve;output"C2ans";
""""""""
"""42"""""
slow"program"
fast"code"
"super"fast"program"
"super"faster"program"
X""
X
I"S""CREAM"
I"CE""CREAM"
11"22"11
1"33"111
.

Output for the Sample Input

IDENTICAL
CLOSE
DIFFERENT
CLOSE
DIFFERENT
DIFFERENT
DIFFERENT
CLOSE
DIFFERENT



Sample input:
print"hello";print123
print"hello";print123
read"B1input";solve;output;
read"B2";solve;output;
read"C1";solve;output"C1ans";
read"C2";solve;output"C2ans";
""""""""
"""42"""""
slow"program"
fast"code"
"super"fast"program"
"super"faster"program"
X""
X
I"S""CREAM"
I"CE""CREAM"
11"22"11
1"33"111
.


Sample output:
IDENTICAL
CLOSE
DIFFERENT
CLOSE
DIFFERENT
DIFFERENT
DIFFERENT
CLOSE
DIFFERENT

Submission status: Accepted

Solution code:
while True:
    s1 = input()
    if s1 == ".":
        break
    s2 = input().split("\"")
    s1 = s1.split("\"")
    if len(s1) != len(s2):
        print("DIFFERENT")
    else:
        fin = False
        count = 0
        for i in range(len(s1)):
            if i%2 == 0:
                if s1[i] != s2[i]:
                    print("DIFFERENT")
                    fin = True
                    break
            else:
                if s1[i] != s2[i]:
                    count += 1
                    if count > 1:
                        print("DIFFERENT")
                        fin = True
                        break
        if not fin:
            if count == 1:
                print("CLOSE")
            elif count == 0:
                print("IDENTICAL")

Submission status: Accepted

Solution code:
ans_list = []

def solve():
    S = input()
    if S == ".":
        return "end"
    T = input()

    if S == T:
        return "IDENTICAL"

    cs = []
    ct = []

    ns = []
    nt = []

    tmp = ""
    flag = False
    for s in S:
        if s == '"':
            if flag:
                flag = False
                cs.append(tmp)
            else:
                flag = True
                ns.append(tmp)
            tmp = ""
            continue
        tmp += s
    ns.append(tmp)

    tmp = ""
    flag = False
    for t in T:
        if t == '"':
            if flag:
                flag = False
                ct.append(tmp)
            else:
                flag = True
                nt.append(tmp)
            tmp = ""
            continue
        tmp += t
    nt.append(tmp)

    if ns != nt or len(cs) != len(ct):
        return "DIFFERENT"
    
    cnt = 0
    for csi, cti in zip(cs, ct):
        if csi != cti:
            cnt += 1
    
    if cnt == 1:
        return "CLOSE"
    else:
        return "DIFFERENT"
    

while True:
    ans = solve()
    if ans == "end":
        break
    ans_list.append(ans)

for ans in ans_list:
    print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

while True:
    s1 = input()
    if s1 == '.':
        break
    else:
        s2 = input()
        s1,s2 = s1.split('\"'),s2.split('\"')
        if len(s1) != len(s2):
            print('DIFFERENT')
        else:
            L = len(s1)
            cnt = 0
            for i in range(L):
                d1,d2 = s1[i],s2[i]
                if i%2 == 0:
                    if d1 != d2:
                        print('DIFFERENT')
                        break
                elif i%2 == 1:
                    if d1 != d2:
                        cnt += 1
            else:
                if cnt == 0:
                    print('IDENTICAL')
                elif cnt == 1:
                    print('CLOSE')
                else:
                    print('DIFFERENT')

Submission status: Accepted

Solution code:
while True:

    #strings1 = []
    #strings2 = []

    k1 = []
    g1 = []
    k2 = []
    g2 = []
    check=input()
    if check == ".":
        break
    strings1 = list(map(str, check.split('"')))

    strings2 = list(map(str, input().split('"')))

    nagasa1 = len(strings1)
    nagasa2 = len(strings2)

    for i in range(nagasa1):
        if i % 2 == 0:
            g1.append(strings1[i])
        else:
            k1.append(strings1[i])

    for i in range(nagasa2):
        if i % 2 == 0:
            g2.append(strings2[i])
        else:
            k2.append(strings2[i])

    lengthk1 = len(k1)
    lengthg1 = len(g1)
    lengthk2 = len(k2)
    lengthg2 = len(g2)

    points = 0

    if lengthg1 == lengthg2:
        for i in range(lengthg1):
            if g1[i] == g2[i]:
                pass
            else:
                points += 2
    else:
        points += 2

    if lengthk1 == lengthk2:
        for i in range(lengthk1):
            if k1[i] == k2[i]:
                pass
            else:
                points += 1
    else:
        if lengthk1 - lengthk2 == 1 or lengthk1 - lengthk2 == -1:
            if lengthk1 < lengthk2:
                for i in range(lengthk1):
                    if k1[i] == k2[i]:
                        pass
                    else:
                        points += 1
            else:
                for i in range(lengthk2):
                    if k1[i] == k2[i]:
                        pass
                    else:
                        points += 1
        else:
            points += 2

    if points==0:
        print("IDENTICAL")
    elif points==1:
        print("CLOSE")
    else:
        print("DIFFERENT")

Submission status: Accepted

Solution code:
while(1):
    s = input()
    if s=='.': break
    s = list(s.split('"'))
    t = list(input().split('"'))
    if len(s) != len(t):
        print("DIFFERENT")
    else:
        cnt=0
        ss=len(s)
        for i in range(ss):
            if i%2==0 and s[i]!=t[i]:
                cnt=100
            elif i%2==1 and s[i]!=t[i]:
                cnt+=1
        if cnt==1:
            print("CLOSE")
        elif cnt==0:
            print("IDENTICAL")
        else:
            print("DIFFERENT")

Submission status: Accepted

Solution code:
while True:
  s1 = input()
  if s1==".":
    break
  s2 = input()

  s1words = []
  s2words = []
  s1split = ""
  s2split = ""

  flag = False
  string = ""
  for e in s1:
    if not flag and e=='"':
      flag = True
      s1split += e
    elif flag and e=='"':
      flag = False
      s1split += e
      s1words.append(string)
      string = ""
    elif flag:
      string += e
    else:
      s1split += e

  flag = False
  string = ""
  for e in s2:
    if not flag and e=='"':
      flag = True
      s2split += e
    elif flag and e=='"':
      flag = False
      s2split += e
      s2words.append(string)
      string = ""
    elif flag:
      string += e
    else:
      s2split += e

  wrong = 0
  if len(s1words)!=len(s2words):
    print("DIFFERENT")
  else:
    for s, t in zip(s1words, s2words):
      if s!=t:
        wrong += 1
    if wrong==0 and s1split==s2split:
      print("IDENTICAL")
    elif wrong==1 and s1split==s2split:
      print("CLOSE")
    else:
      print("DIFFERENT")

Submission status: Accepted

Solution code:
while True:
  S_1 = input()
  if S_1 == '.':
    break
  S_2 = input()
  
  if S_1 == S_2:
    print("IDENTICAL")
    continue
  
  A = [0]
  B = [0]
  for i, s in enumerate(S_1):
    if s == '"':
      A.append(i)
  for i, s in enumerate(S_2):
    if s == '"':
      B.append(i)
      
  if len(A) != len(B):
    print('DIFFERENT')
    continue
  
  A.append(len(S_1))
  B.append(len(S_2))
  cnt = 0
  
  for i in range(len(A) - 1):
    if i % 2 == 0 and S_1[A[i]:A[i + 1]] != S_2[B[i]:B[i + 1]]:
      print('DIFFERENT')
      break
    if i % 2 == 1 and S_1[A[i]:A[i + 1]] != S_2[B[i]:B[i + 1]]:
      cnt += 1
  else:
      print('DIFFERENT' if cnt > 1 else 'CLOSE')

Submission status: Accepted

Solution code:
"""
与えられた二つのプログラムが完全に等しければ IDENTICAL と出力せよ．
二つのプログラム中の対応する文字列定数一つだけが異なるならば CLOSE と出力せよ．
それ以外の場合，DIFFERENT と出力せよ．
"""
import re


while True:
    s1 = str(input())
    if s1 == '.':
        break
    s2 = str(input())

    moziretsuteisu_s1 = re.findall("\".*?\"", s1)
    moziretsuteisu_s2 = re.findall("\".*?\"", s2)

    new_s1 = re.sub("\".*?\"", " ", s1)
    new_s2 = re.sub("\".*?\"", " ", s2)

    cnt = 0
    if len(moziretsuteisu_s1) != len(moziretsuteisu_s2):
        cnt = 2
    else:
        for x, y in zip(moziretsuteisu_s1, moziretsuteisu_s2):
            if x != y:
                cnt += 1

    if s1 == s2:
        print("IDENTICAL")
    elif cnt == 1 and new_s1 == new_s2:
        print("CLOSE")
    else:
        print("DIFFERENT")

Submission status: Accepted

Solution code:
while True:
    s = input().split('"')
    if s == ['.']:
        exit()
    t = input().split('"')

    is_diff = False
    is_close = 0
    if len(s) == len(t):
        for i in range(len(s)):
            if i % 2 == 0:
                if s[i] != t[i]:
                    is_diff = True
            else:
                if s[i] != t[i]:
                    is_close += 1
    else:
        is_diff = True

    if is_diff:
        print('DIFFERENT')
    elif is_close == 0:
        print('IDENTICAL')
    else:
        print(['CLOSE', 'DIFFERENT'][is_close > 1])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# python template for atcoder1
import re
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def solve():
    s1 = input()[:-1]
    if s1 == ".":
        exit()
    else:
        s2 = input()[:-1]

    s1_split = s1.split('"')
    s2_split = s2.split('"')
    diff_word = []
    ans = "DIFFERENT"
    for a, b in zip(s1_split, s2_split):
        if a == b:
            continue
        else:
            diff_word.append(a)
    if len(s1_split) == len(s2_split):
        if len(diff_word) == 0:
            ans = "IDENTICAL"
        elif len(diff_word) == 1:
            pattern = '\"(.*?)\"'
            reg = re.compile(pattern)
            str_const = reg.findall(s1)
            if diff_word[0] in str_const:
                ans = "CLOSE"
    print(ans)


while True:
    solve()

Submission status: Accepted

Solution code:
while True:
    data = input()
    if data == ".": break

    inqrt1 = []
    outqrt1 = []

    nowqrt = False
    stringin = ""
    stringout = ""
    count = 0
    for char in data:
        if nowqrt:
            if char != '"' and count != len(data) - 1:
                stringin += char
            else:
                if count == len(data) - 1: stringin += char
                inqrt1.append(stringin)
                stringin = ""
                nowqrt = False
        else:
            if char != '"' and count != len(data) - 1:
                stringout += char
            else:
                if count == len(data) - 1: stringout += char
                nowqrt = True
                outqrt1.append(stringout)
                stringout = ""
        count += 1

    data = input()
    inqrt2 = []
    outqrt2 = []

    nowqrt = False
    stringin = ""
    stringout = ""
    count = 0
    for char in data:
        if nowqrt:
            if char != '"' and count != len(data) - 1:
                stringin += char
            else:
                if count == len(data) - 1: stringin += char
                inqrt2.append(stringin)
                stringin = ""
                nowqrt = False
        else:
            if char != '"' and count != len(data) - 1:
                stringout += char
            else:
                if count == len(data) - 1: stringout += char
                nowqrt = True
                outqrt2.append(stringout)
                stringout = ""
        count += 1

    difcount = 0
    if len(inqrt1) != len(inqrt2) or outqrt1 != outqrt2:
        print("DIFFERENT")
    elif inqrt1 == inqrt2:
        print("IDENTICAL")
    else:
        for i in range(len(inqrt1)):
            if inqrt1[i] != inqrt2[i]: difcount += 1
        if difcount <= 1: print("CLOSE")
        else: print("DIFFERENT")

Submission status: Accepted

Solution code:
def solve(s,t):
	if s==t:
		return 'IDENTICAL'
	s=s.split('"')
	t=t.split('"')
	if len(s)==len(t):
		k0=sum(s[i]!=t[i] for i in range(0,len(s),2))
		k1=sum(s[i]!=t[i] for i in range(1,len(s),2))
		if k0==0 and k1==1:
			return 'CLOSE'
	return 'DIFFERENT'

while True:
	s=input()
	if s=='.':
	    break
	t=input()
	print(solve(s,t))

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    rr = []

    def f(s,t):
        if s == t:
            return 'IDENTICAL'
        sa = s.split('"')
        ta = t.split('"')
        if len(sa) != len(ta):
            return 'DIFFERENT'
        ef = False
        for i in range(len(sa)):
            si = sa[i]
            ti = ta[i]
            if si == ti:
                continue
            if i % 2 == 0 or ef:
                return 'DIFFERENT'
            ef = True
        return 'CLOSE'

    while 1:
        n = S()
        if n == '.':
            break
        rr.append(f(n,S()))

    return '\n'.join(map(str,rr))


print(main())

Submission status: Accepted

Solution code:
def solve(s1,s2):
    if s1 == s2:
        return 0

    l1,l2 = s1.split('"'),s2.split('"')
    if len(l1) != len(l2):
        return 1

    ct = 0
    for i in range(len(l1)):
        if i%2 == 0:
            if l1[i] != l2[i]:
                return 1
        else:
            if l1[i] != l2[i]:
                ct += 1
            if ct > 1:
                return 1
    return 2

def main():
    ans = ['IDENTICAL', 'DIFFERENT', 'CLOSE']
    while True:
        s1 = input()
        if s1 == '.':
            return
        s2 = input()
        print(ans[solve(s1,s2)])

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def is_same(s1, s2):
  sp1 = s1.split("\"")
  sp2 = s2.split("\"")
  if len(sp1) != len(sp2):
    return 2
  
  count = 0
  for i in range(len(sp1)):
    if i % 2 == 0:
      if sp1[i] != sp2[i]:
        return 2
    else:
      if sp1[i] != sp2[i]:
        count += 1
        if count >= 2:
          return 2
  return count

while True:
  s1 = input()
  if s1 == ".":
    break
  s2 = input()
  result = is_same(s1, s2)
  if result == 0:
    print("IDENTICAL")
  elif result == 1:
    print("CLOSE")
  else:
    print("DIFFERENT")

Submission status: Accepted

Solution code:
while 1:
    a = input()
    if a == ".":
        break
    b = input()
    if a == b:
        print("IDENTICAL")
    else:
        a = a.split("\"")
        b = b.split("\"")
        if len(a) != len(b):
            print("DIFFERENT")
        else:
            key = [0,0]
            for i in range(len(a)):
                if a[i] != b[i]:
                    key[i%2] += 1
            print("CLOSE" if key == [0,1] else "DIFFERENT")

Submission status: Runtime Error

Solution code:
while True:
    s1 = input()
    if s1 == ".":
        break
    s2 = input()

    listed_s1 = [[]]
    listed_s2 = [[]]
    start = 0
    now = 0
    for i in range(len(s1)):
        if s1[i] == "\"" and not start:
            listed_s1.append([])
            now += 1
            start = 1
            listed_s1[now].append(s1[i])
        elif s1[i] == "\"" and start:
            listed_s1[now].append(s1[i])
            listed_s1.append([])
            now += 1
            start = 0
        else:
            listed_s1[now].append(s1[i])

    now = 0
    for i in range(len(s2)):
        if s2[i] == "\"" and not start:
            listed_s2.append([])
            now += 1
            start = 1
            listed_s2[now].append(s2[i])
        elif s2[i] == "\"" and start:
            listed_s2[now].append(s2[i])
            listed_s2.append([])
            now += 1
            start = 0
        else:
            listed_s2[now].append(s2[i])

    fist_wrong = 0
    ans = "IDENTICAL"
    for i in range(min(len(listed_s1), len(listed_s2))):
        if listed_s1[i] != listed_s2[i]:
            if listed_s1[i][0] == "\"" and listed_s2[i][-1] == "\"" and listed_s2[i][0] == "\"" and listed_s2[i][-1] == "\"":
                if fist_wrong:
                    ans = "DIFFERENT"
                else:
                    fist_wrong = 1
                    ans = "CLOSE"

            else:
                ans = "DIFFERENT"
        if ans == "DIFFERENT":
            break
    if len(listed_s1) != len(listed_s2):
        ans = "DIFEERENT"


    print(ans)

Submission status: Runtime Error

Solution code:
while 1:
    s1 = input().split('"')
    if s1 is '.':
        break
    s2 = input().split('"')
    if len(s1) != len(s2):
        print("DIFFERENT")
        continue
    r = [0]*2
    for i in range(len(s1)):
        if s1[i] != s2[i]:
            r[i%2] += 1
    if [0,1]<r:
        print("DIFFERENT")
    else:
        print(["IDENTICAL","CLOSE"][r[1]])

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
from typing import List

def rdp_connect() -> bool:
    global s1, s2
    s1 = input()
    if s1 == '.':
        return False
    s2 = input()
    return True

def rdp_token(s: str) -> List[str]:
    res = []
    while s:
        match = re.match(r'[a-zA-Z0-9;]+', s)
        if match:
            res.append(s[:match.end()])
            s = s[match.end():]
            continue
        match = re.match(r'"[^"]*"', s)
        if match:
            res.append(s[:match.end()-1])
            s = s[match.end():]
            continue
    return res

def rdp_check() -> bool:
    l1 = rdp_token(s1)
    l2 = rdp_token(s2)
    if len(l1) != len(l2):
        return False
    flag = True
    for t1, t2 in zip(l1, l2):
        if t1 == t2:
            continue
        if t1[0] == t2[0] == '"' and flag:
            flag = False
        else:
            return False
    return True

if __name__ == '__main__':
    while rdp_connect():
        if s1 == s2:
            print('IDENTICAL')
        elif rdp_check():
            print('CLOSE')
        else:
            print('DIFFERENT')

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
from typing import List

def rdp_connect() -> bool:
    global s1, s2
    s1 = input()
    if s1 == '.':
        return False
    s2 = input()
    return True

def rdp_token(s: str) -> List[str]:
    res = []
    while s:
        match = re.match(r'[a-zA-Z0-9;]+', s)
        if match:
            res.append(s[:match.end()])
            s = s[match.end():]
            continue
        match = re.match(r'"[^"]*"', s)
        if match:
            res.append(s[:match.end()-1])
            s = s[match.end():]
            continue
        break
    return res

def rdp_check() -> bool:
    l1 = rdp_token(s1)
    l2 = rdp_token(s2)
    if len(l1) != len(l2):
        return False
    flag = True
    for t1, t2 in zip(l1, l2):
        if t1 == t2:
            continue
        if t1[0] == t2[0] == '"' and flag:
            flag = False
        else:
            return False
    return True

if __name__ == '__main__':
    while rdp_connect():
        if s1 == s2:
            print('IDENTICAL')
        elif rdp_check():
            print('CLOSE')
        else:
            print('DIFFERENT')

Submission status: Runtime Error

Solution code:
s=[]

while 1:
        l1=list(input().split())
        if l1==".":
            break
        l2=list(input().split())

        if l1==l2:
            s+=["INDENTCAL"]
        elif len(set(l1+l2))==1:
            s+=["CLODSE"]
        else:
            s+=["DIFFERENT"]


print(s)

Submission status: Runtime Error

Solution code:
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    for i in range(len(a)):
        if(i%2==0):
            del(a[i])
    for i in range(len(b)):
        if(i%2==0):
            del(b[i])    
    count=0
    for i,j in zip(a,b):
        for k,l in zip(a[i],b[j]):
            if(k!=l):
                count+=1
    if count==0:
        results.append(0)
    elif count==1:
        results.append(1)
    else:
        results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")

Submission status: Runtime Error

Solution code:
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count=0
    for i,j in zip(range(len(a)),range(len(b))):
        for k,l in zip(a[2*i+1],b[2*j+1]):
            if(k!=l):
                count+=1
    if count==0:
        results.append(0)
    elif count==1:
        results.append(1)
    else:
        results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")

Submission status: Runtime Error

Solution code:
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count=0
    for i,j in zip(range(len(a)/2),range(len(b)/2)):
        for k,l in zip(a[2*i+1],b[2*j+1]):
            if(k!=l):
                count+=1
    if count==0:
        results.append(0)
    elif count==1:
        results.append(1)
    else:
        results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")

Submission status: Runtime Error

Solution code:
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count=0
    for i,j in zip(range(len(a)),range(len(b)):
        for k,l in zip(a[2*i],b[2*j]):
            if(k!=l):
                count+=1
    if count==0:
        results.append(0)
    elif count==1:
        results.append(1)
    else:
        results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")

Submission status: Runtime Error

Solution code:
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count=0
    for i in range(len(a)):
        for k,l in zip(a[2*i],b[2*i]):
            if(k!=l):
                count+=1
    if count==0:
        results.append(0)
    elif count==1:
        results.append(1)
    else:
        results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")

Submission status: Runtime Error

Solution code:
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count=0
    for i in range(int(len(a)/2)):
        for k,l in zip(a[2*i],b[2*i]):
            if(k!=l):
                count+=1
    if count==0:
        results.append(0)
    elif count==1:
        results.append(1)
    else:
        results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")

Submission status: Runtime Error

Solution code:
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count=0
    for i in range(0,int(len(a)/2)):
        for k,l in zip(a[2*i+1],b[2*i+1]):
            if(k!=l):
                count+=1
    if count==0:
        results.append(0)
    elif count==1:
        results.append(1)
    else:
        results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")

Submission status: Runtime Error

Solution code:
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count=0
    for i in range(int(len(a)/2)):
        for k,l in zip(a[2*i+1],b[2*i+1]):
            if(k!=l):
                count+=1
    if count==0:
        results.append(0)
    elif count==1:
        results.append(1)
    else:
        results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")

Submission status: Runtime Error

Solution code:

while 1:
    key = 0
    s1 = input()
    if s1 == '.':
        break
    s2 = input()
    if len(s1) == len(s2):
        for i in range(len(s1)):
            if s1[i] != s2[i]:
                key += 1
            if key >= 2:
                output.append('DIFFERENT')
                break
        if key == 0:
            output.append('IDENTICAL')
        elif key == 1:
            output.append('CLOSE')

    else:
        if len(s1) > len(s2):
            d = len(s1) - len(s2)
            if d >= 2:
                output.append('DIFFERENT')
                break
            elif d == 1:
                output.append('DIFFERENT')
                break
        else:
            d = len(s2) - len(s1)
            if d >= 2:
                output.append('DIFFERENT')
                break
            elif d == 1:
                output.append('DIFFERENT')
                break


for i in range(len(output)):
    print(output[i])

Submission status: Runtime Error

Solution code:

while 1:
    key = 0
    s1 = input()
    if s1 == '.':
        break
    s2 = input()
    if len(s1) == len(s2):
        for i in range(len(s1)):
            if s1[i] != s2[i]:
                key += 1
            if key >= 2:
                output.append('DIFFERENT')
                break
        if key == 0:
            output.append('IDENTICAL')
        elif key == 1:
            output.append('CLOSE')

    else:
        if len(s1) > len(s2):
            d = len(s1) - len(s2)
            if d >= 2:
                output.append('DIFFERENT')
                break
            elif d == 1:
                output.append('CLOSE')
                break
        else:
            d = len(s2) - len(s1)
            if d >= 2:
                output.append('DIFFERENT')
                break
            elif d == 1:
                output.append('CLOSE')
                break


for i in range(len(output)):
    print(output[i])

Submission status: Runtime Error

Solution code:
while 1:
    s1 = input().split('\"')
    if s1[0] == '.': break
    s2 = input().split('\"')

    jdg = 1
    cnt_d = 

    if len(s1) != len(s2): print("DIFFERENT")
    else:
        l = len(s1)
        i = 0
        while i < l:
            if s1[i] != s2[i]:
                cnt_d += 1
                if cnt_d == 1 and i % 2 == 1:
                    jdg = 1
                else:
                    jdg = 0
                    break
            i += 1

        if jdg == 1 and cnt_d == 1: print("CLOSE")
        elif jdg == 0 or cnt_d > 1: print("DIFFERENT")
        else: print("IDENTICAL")

Submission status: Runtime Error

Solution code:
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count1=0
    count2=0
    print(a)
    print(b)
    for i in range(int(len(a))):
        if(i%2==1):
            for k,l in zip(a[i],b[i]):
                if(k!=l):
                    count1+=1
        else:
            for k,l in zip(a[i],b[i]):
                if(k!=l):
                    count2+=1
        if len(a) != len(b):
            results.append(2)
        else:
            if count1==0 and count2==0:
                results.append(0)
            elif count1==1 and count2==0:
                results.append(1)
            else:
                results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")

Submission status: Runtime Error

Solution code:
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count1=0
    count2=0
    for i in range(int(len(a))):
        if(i%2==1):
            for k,l in zip(a[i],b[i]):
                if(k!=l):
                    count1+=1
        else:
            for k,l in zip(a[i],b[i]):
                if(k!=l):
                    count2+=1
        if len(a) != len(b):
            results.append(2)
        else:
            if count1==0 and count2==0:
                results.append(0)
            elif count1==1 and count2==0:
                results.append(1)
            else:
                results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")

Submission status: Runtime Error

Solution code:
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count1=0
    count2=0
    for i in range(int(len(a))):
        if(i%2==1):
            for k,l in zip(a[i],b[i]):
                if(k!=l):
                    count1+=1
        else:
            for k,l in zip(a[i],b[i]):
                if(k!=l):
                    count2+=1
    if len(a) != len(b):
        results.append(2)
    else:
        if count1==0 and count2==0:
            results.append(0)
        elif count1==1 and count2==0:
            results.append(1)
        else:
            results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")