alexjercan/bugnet huggingface dataset:
Problem p01101 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <vector>
using namespace std;
int main(void) {
  int n, m;
  while (cin >> n >> m, n || m) {
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    int ans = -1;
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        if (m >= a[i] + a[j])
          ans = max(ans, a[i] + a[j]);
      }
    }
    if (ans == -1)
      cout << "NONE" << endl;
    else
      cout << ans << endl;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
#include <vector>

int main() {

  int n, m, price, sum, temp_sum;
  sum = 0;
  // std::vector<int> prices;
  int prices[1000];

  while (std::cin >> n >> m, n || m) {

    std::cin >> n >> m;

    for (int i = 0; i < n; i++) {
      std::cin >> prices[i];
      // prices.push_back(price);
    }

    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        temp_sum = prices[i] + prices[j];
        if (sum < temp_sum && temp_sum < m)
          sum = temp_sum;
      }
    }

    if (sum == 0) {
      std::cout << "NONE" << std::endl;
    } else {
      std::cout << sum << std::endl;
    }
  }

  return 0;
}
Problem p01101 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
#include <stdlib.h>

using namespace std;
const int MAX_N = 1024;

int kk[MAX_N * MAX_N + 1];

int n, m, Max;
int a[1024];

int compare_int(const void *a, const void *b) { return *(int *)b - *(int *)a; }

int solve(void) {

  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (Max < a[i] + a[j] && i != j && a[i] + a[j] <= m)
        Max = a[i] + a[j];

  qsort(kk, n * n, sizeof(int), compare_int);

  if (Max != 0) {
    cout << Max << endl;
  } else {
    cout << "NONE" << endl;
  }
}

int main(void) {
  while (1) {
    Max = 0;
    cin >> n >> m;
    if (n == 0 && m == 0)
      break;
    for (int i = 0; i < n; ++i)
      cin >> a[i];

    solve();
  }
}


Error: TLE

Fixed submission:

#include <iostream>
#include <stdlib.h>

using namespace std;
const int MAX_N = 1024;

int kk[MAX_N * MAX_N + 1];

int n, m, Max;
int a[1024];

int compare_int(const void *a, const void *b) { return *(int *)b - *(int *)a; }

int solve(void) {

  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (Max < a[i] + a[j] && i != j && a[i] + a[j] < m)
        Max = a[i] + a[j];

  qsort(kk, n * n, sizeof(int), compare_int);

  cout << Max << endl;
}

int main(void) {
  while (1) {
    Max = 0;
    cin >> n >> m;
    for (int i = 0; i < n; ++i)
      cin >> a[i];

    solve();
  }
}
Problem p01101 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <iostream>
using namespace std;

int main() {
  int n, m;
  while (1) {
    int a[1000] = {}, ans = 0;
    cin >> n >> m;
    if (n == 0 && m == 0)
      break;
    for (int i = 0; i < n; i++)
      cin >> a[i];
    for (int i = 0; i < n - 1; i++) {
      for (int j = i + 1; j < n; j++) {
        if (a[i] + a[j] <= m)
          ans = max(ans, a[i] + a[j]);
      }
    }
    if (ans)
      cout << ans << "\\n";
    else
      cout << "NONE\\n";
  }
  return 0;
}

Error: WA

Fixed submission:

#include <algorithm>
#include <iostream>
using namespace std;

int main() {
  int n, m, a[1000], dp[1001], b = 0;
  dp[0] = 0;
  while (1) {
    cin >> n, m;
    if (n == 0 && m == 0)
      break;
    for (int i = 0; i < n; i++)
      cin >> a[i];
    for (int i = 1; i <= n; i++) {
      dp[i] = max(dp[i - 1], b + a[i - 1]);
      b = max(b, a[i - 1]);
    }
    cout << dp[1000] << endl;
  }
  return 0;
}
Problem p01101 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
int main() {
  while (1) {
    int n, m, tmp = 0;
    int max = -1;
    int A[1000] = {0};
    std::cin >> n >> m;
    for (int i = 0; i < n; i++) {
      std::cin >> A[i];
    }
    if (A[0] == 0 && A[1] == 0) {
      break;
    }
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        tmp = A[i] + A[j];
        if (tmp > max && tmp <= m) {
          max = tmp;
        }
      }
    }
    if (max > 0) {
      std::cout << max << "\\n";
    } else {
      std::cout << "NONE\\n";
    }
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
int main() {
  while (1) {
    int n, m, tmp = 0;
    int max = -1;
    int A[1000];
    std::cin >> n >> m;
    for (int i = 0; i < n; i++) {
      std::cin >> A[i];
    }
    if (A[0] == 0 && A[1] == 0) {
      break;
    }
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        tmp = A[i] + A[j];
        if (tmp > max && tmp <= m) {
          max = tmp;
        }
      }
    }
    if (max > 0) {
      std::cout << max << "\\n";
    } else {
      std::cout << "NONE\\n";
    }
  }
}
Problem p01101 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int main() {
  int n, m;
  while (1) {
    cin >> n >> m;
    if (n == 0 && m == 0)
      break;
    vector<int> price;
    for (int i = 0; i < n; i++) {
      int x;
      cin >> x;
      if (x < m)
        price.push_back(x);
    }

    int max = 0;
    for (int i = 0; i < price.size(); i++) {
      for (int j = i + 1; j < price.size(); j++) {
        int sum = price[i] + price[j];
        if (sum <= m && sum >= max) {
          max = sum;
        }
      }
    }
    if (max != 0)
      cout << max << endl;
    else
      cout << "NONE" << endl;
  }
  return 0;
}

Error: 0

Fixed submission:

#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int main() {
  int n, m;
  while (1) {
    cin >> n >> m;
    if (n == 0 && m == 0)
      break;
    vector<int> price;
    for (int i = 0; i < n; i++) {
      int x;
      cin >> x;
      if (x < m)
        price.push_back(x);
    }

    sort(price.begin(), price.end());

    int max = 0;
    for (int i = 0; i < n / 2; i++) {
      for (int j = i + 1; j < n; j++) {
        int sum = price[i] + price[j];
        if (sum <= m && sum >= max) {
          max = sum;
        }
      }
    }
    if (max != 0)
      cout << max << endl;
    else
      cout << "NONE" << endl;
  }
  return 0;
}
Problem p01101 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <sstream>
using namespace std;

int main() {
  int n, m, max;
  int a[1000];

  while (cin >> n >> m) {
    max = 0;
    if (n == 0 && m == 0)
      break;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (int i = 0; i < n - 1; i++) {
      for (int j = i + 1; j < n; j++) {
        if (a[i] + a[j] <= m) {
          if (a[i] + a[j] >= max) {
            max = a[i] + a[j];
          }
        }
      }
    }
    if (max == 0) {
      cout << "NONE\\n";
    } else {
      cout << max << "\\n";
    }
  }
}


Error: WA

Fixed submission:

#include <iostream>
#include <sstream>
using namespace std;

int main() {
  int n, m, max = 0, k = 0;
  int a[1000];
  int ans[50000];

  while (cin >> n >> m) {
    if (n == 0 && m == 0)
      break;
    for (int i = 0; i < n - 1; i++) {
      cin >> a[i];
    }
    for (int i = 0; i < n - 1; i++) {
      for (int j = i + 1; j < n; j++) {
        if (a[i] + a[j] <= m) {
          if (a[i] + a[j] >= max) {
            max = a[i] + a[j];
          }
        }
      }
    }
    ans[k] = max;
    k++;
  }
  for (int i = 0; i < k; i++) {
    cout << ans[i] << "\\n";
  }
}
Problem p01101 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int n, m;
  while (cin >> n >> m, n || m) {
    vector<int> data(n);
    for (int i = 0; i < n; i++) { // input
      cin >> data[i];
    }

    int max = 0;
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        int tmp = data[i] + data[j];
        if (tmp <= m && tmp > max) {
          max = tmp;
        }
      }
    }

    if (max == 0) { // output
      cout << "NONE" << endl;
    } else {
      cout << max << endl;
    }
  }

  return 0;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int n, m;
  while (cin >> m >> n, n || m) {
    vector<int> data(n);
    for (int i = 0; i < n; i++) { // input
      cin >> data[i];
    }

    int max = 0;
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        int tmp = data[i] + data[j];
        if (tmp <= m && tmp > max) {
          max = tmp;
        }
      }
    }

    if (max == 0) { // output
      cout << "NONE" << endl;
    } else {
      cout << max << endl;
    }
  }

  return 0;
}
Problem p01101 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
#include <vector>
using namespace std;
int main(int argc, char *argv[]) {
  for (;;) {
    int n, m;
    cin >> n >> m;
    if (n == 0 && m == 0)
      break;
    vector<int> is;
    for (int i = 0; i < n; i++) {
      int c;
      cin >> c;
      is.push_back(c);
    }
    int best = -1;
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        int k = is[i] + is[j];
        if (k <= m && k > best)
          best = k;
      }
    }
    if (best < 0)
      cout << "NONE" << endl;
    else
      cout << best << endl;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
#include <vector>
using namespace std;
int main(int argc, char *argv[]) {
  for (;;) {
    int n, m;
    cin >> n >> m;
    vector<int> is;
    for (int i = 0; i < n; i++) {
      int c;
      cin >> c;
      is.push_back(c);
    }
    int best = 0;
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        int k = is[i] + is[j];
        if (k <= m && k > best)
          best = k;
      }
    }
    cout << best << endl;
  }
  return 0;
}
Problem p01101 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;

int main() {
  int n, m;
  int maximum;
  int a[1000];
  while (true) {
    cin >> n >> m;
    if (n == 0 && m == 0)
      break;
    maximum = 0;
    for (int j = 0; j < n; j++) {
      cin >> a[j];
    }
    for (int j = 0; j < n - 1; j++) {
      for (int t = j + 1; t < n; t++) {
        if (a[j] + a[t] <= m) {
          maximum = max(maximum, a[j] + a[t]);
        }
      }
    }
    if (maximum == 0) {
      cout << "NONE" << endl;
    } else {
      cout << maximum << endl;
    }
  }
}


Error: WA

Fixed submission:

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;

int main() {
  int n, m;
  int maximum;
  vector<int> a(n);
  while (true) {
    cin >> n >> m;
    if (n == 0 && m == 0)
      break;
    for (int j = 0; j < n; j++) {
      cin >> a[j];
    }
    for (int j = 0; j < n - 1; j++) {
      for (int t = j + 1; t < n; t++) {
        if (a[j] + a[t] <= m) {
          maximum = max(maximum, a[j] + a[t]);
        }
      }
    }
    if (maximum == 0) {
      cout << "NONE" << endl;
    } else {
      cout << maximum << endl;
    }
  }
}
Problem p01101 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int main() {
  while (1) {
    int n, m, i, j, ans = 0;
    cin >> n >> m;
    vector<int> p(n);
    if (n == 0 && m == 0)
      break;
    for (i = 0; i < n; i++) {
      cin >> p[i];
    }
    for (i = 0; i < n; i++) {
      for (j = i + 1; j < n; j++) {
        if (p[i] + p[j] <= m && ans < p[i] + p[j])
          ans = p[i] + p[j];
      }
    }
    if (ans == 0)
      cout << "NONE" << endl;
    else
      cout << ans << endl;
  }
  return 0;
}


Error: -6
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc


Fixed submission:

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int main() {
  while (1) {
    long long n, m, i, j, ans = 0;
    vector<long long> p(n);
    cin >> n >> m;
    if (n == 0 && m == 0)
      break;
    for (i = 0; i < n; i++) {
      cin >> p[i];
    }
    for (i = 0; i < n; i++) {
      for (j = i + 1; j < n; j++) {
        if (p[i] + p[j] <= m && ans < p[i] + p[j])
          ans = p[i] + p[j];
      }
    }
    if (ans == 0)
      cout << "NONE" << endl;
    else
      cout << ans << endl;
  }
  return 0;
}
Problem p01101 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int main() {
  int n, m, MAX = 0, SUM;
  int a, size;
  vector<int> v;

  while (cin >> n >> m, n) {

    int MAX = 0, SUM, a, size;
    vector<int> v;

    for (int i = 0; i < n; i++) {
      cin >> a;
      v.push_back(a);
    }

    for (int i = 0; i < v.size(); i++) {
      for (int j = i + 1; j < v.size(); j++) {
        SUM = v[i] + v[j];
        if (SUM <= m) {
          MAX = max(MAX, SUM);
          // cout << MAX << endl;
        }
      }
    }

    if (MAX == 0) {
      cout << "NONE" << endl;
    } else {
      cout << MAX << endl;
    }
  }

  return 0;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int main() {
  int n, m, MAX = 0, SUM;
  int a, size;
  vector<int> v;

  while (cin >> n >> m, n) {

    for (int i = 0; i < n; i++) {
      cin >> a;
      v.push_back(a);
    }

    for (int i = 0; i < v.size(); i++) {
      for (int j = i + 1; j < v.size(); j++) {
        SUM = v[i] + v[j];
        if (SUM <= m) {
          MAX = max(MAX, SUM);
          // cout << MAX << endl;
        }
      }
    }

    if (MAX == 0) {
      cout << "NONE" << endl;
    } else {
      cout << MAX << endl;
    }
  }

  return 0;
}
Problem p01101 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <string>
#include <utility>
#include <vector>
#define INF 2147483647
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long

using namespace std;
int main() {
  int n, m;
  while (cin >> n >> m, n + m) {
    int a[n];
    for (int i = 0; i < n; i++)
      cin >> a[i];
    int ans = 0;
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        if (a[i] + a[j] <= m)
          ans = max(ans, a[i] + a[j]);
      }
    }
    if (ans == 0)
      cout << "NONE" << endl;
    else
      cout << ans << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <string>
#include <utility>
#include <vector>
#define INF 2147483647
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long

using namespace std;
int main() {
  int n, m;
  while (cin >> n >> m, n + m) {
    cin >> n >> m;
    int a[n];
    for (int i = 0; i < n; i++)
      cin >> a[i];
    int ans = 0;
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        if (a[i] + a[j] <= m)
          ans = max(ans, a[i] + a[j]);
      }
    }
    if (ans == 0)
      cout << "NONE" << endl;
    else
      cout << ans << endl;
  }
  return 0;
}
Problem p01101 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define FI first
#define SE second
#define VE vector<int>
#define PB push_back
#define PA pair<int, int>
#define MA make_pair
#define LL long long
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define ROF(i, a, b) for (int i = b - 1; i >= a; i--)
#define YES(i) cout << (i ? "YES" : "NO") << endl
#define Yes(i) cout << (i ? "Yes" : "No") << endl
using namespace std;
//
const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
//
int main() {
  int N, M;
  int A[1000];
  while (1) {
    int N, M;
    cin >> N >> M;
    if (N == 0 && M == 0) {
      break;
    }
    FOR(i, 0, N) { cin >> A[i]; }
    VE S;
    FOR(i, 0, N) {
      FOR(j, i + 1, N) { S.PB(A[i] + A[j]); }
    }
    sort(S.begin(), S.end());
    int ans = 0, now = 0;
    while (now < N * (N - 1) / 2) {
      if (S[now] <= M) {
        ans = S[now];
        now++;
      } else {
        break;
      }
    }
    if (now == 0) {
      cout << "NONE" << endl;
    } else {
      cout << ans << endl;
    }
  }
  return 0;
}


Error: 0

Fixed submission:

#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define FI first
#define SE second
#define VE vector<int>
#define PB push_back
#define PA pair<int, int>
#define MA make_pair
#define LL long long
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define ROF(i, a, b) for (int i = b - 1; i >= a; i--)
#define YES(i) cout << (i ? "YES" : "NO") << endl
#define Yes(i) cout << (i ? "Yes" : "No") << endl
using namespace std;
//
const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
//
int main() {
  int N, M;
  int A[1000];
  while (1) {
    int N, M;
    cin >> N >> M;
    if (N == 0 && M == 0) {
      break;
    }
    FOR(i, 0, N) { cin >> A[i]; }
    VE S;
    FOR(i, 0, N) {
      FOR(j, i + 1, N) { S.PB(A[i] + A[j]); }
    }
    sort(S.begin(), S.end());
    int ans = 0, now = 0;
    while (1) {
      if (S[now] <= M) {
        ans = S[now];
        now++;
      } else {
        break;
      }
    }
    if (now == 0) {
      cout << "NONE" << endl;
    } else {
      cout << ans << endl;
    }
  }
  return 0;
}
Problem p01102 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>

using namespace std;

int main() {
  string S, T;
  while (cin >> S, S != ".") {
    cin >> T;
    int beet = 0;
    string latte, malta;
    vector<string> oi, ushi;
    for (int i = 0; i < S.size(); i++) {
      if (beet % 2 == 0)
        latte += S[i], oi.push_back("");
      else
        oi.back() += S[i];
      if (S[i] == '\\"')
        ++beet;
    }
    beet = 0;
    for (int i = 0; i < T.size(); i++) {
      if (beet % 2 == 0)
        malta += T[i], ushi.push_back("");
      else
        ushi.back() += T[i];
      if (T[i] == '\\"')
        ++beet;
    }
    int incorrect = 0;
    if (oi.size() != ushi.size())
      incorrect = 114514;
    else
      for (int i = 0; i < oi.size(); i++)
        incorrect += oi[i] != ushi[i];

    if (latte != malta || incorrect >= 2) {
      cout << "DIFFERENT" << endl;
    } else if (S == T) {
      cout << "IDENTICAL" << endl;
    } else {
      cout << "CLOSE" << endl;
    }
  }
}

Error: 0

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

int main() {
  string S, T;
  while (cin >> S, S != ".") {
    cin >> T;
    int beet = 0;
    string latte, malta;
    vector<string> oi, ushi;
    for (int i = 0; i < S.size(); i++) {
      if (beet % 2 == 0)
        latte += S[i], oi.push_back("");
      else
        oi.back() += S[i];
      if (S[i] == '\\"')
        ++beet;
    }
    beet = 0;
    for (int i = 0; i < T.size(); i++) {
      if (beet % 2 == 0)
        malta += T[i], ushi.push_back("");
      else
        ushi.back() += T[i];
      if (T[i] == '\\"')
        ++beet;
    }
    int incorrect = 0;
    if (oi.size() != ushi.size())
      incorrect = 114514;
    for (int i = 0; i < oi.size(); i++)
      incorrect += oi[i] != ushi[i];

    if (latte != malta || incorrect >= 2) {
      cout << "DIFFERENT" << endl;
    } else if (S == T) {
      cout << "IDENTICAL" << endl;
    } else {
      cout << "CLOSE" << endl;
    }
  }
}
Problem p01102 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
#include <sstream>
#include <string>
#include <vector>

void split(std::vector<std::string> &tmp, std::string &str, char delimiter);

int main() {
  int cnt = 0;
  bool odd;
  std::string str1;
  std::string str2;
  std::string tmp1;
  std::string tmp2;
  while (true) {
    cnt = 0;
    odd = false;
    std::cin >> str1;
    if (str1 == ".") {
      break;
    }
    std::vector<std::string> tmp1;
    split(tmp1, str1, '"');
    std::cin >> str2;
    std::vector<std::string> tmp2;
    split(tmp2, str2, '"');
    int size = tmp1.size();
    int size2 = tmp2.size();
    if (size != size2) {
      cnt += 2;
    } else {
      for (int i = 0; i < size; i++) {
        if (tmp1[i] != tmp2[i]) {
          if (odd) {
            cnt++;
          } else {
            cnt += 2;
            break;
          }
        }
        if (odd) {
          odd = false;
        } else {
          odd = true;
        }
      }
    }

    if (cnt == 0) {
      std::cout << "IDENTICAL\\n";
    } else if (cnt == 1) {
      std::cout << "CLOSE\\n";
    } else {
      std::cout << "DIFFERENT\\n";
    }
  }
}

void split(std::vector<std::string> &tmp, std::string &str, char delimiter) {
  std::istringstream iss(str);
  std::string item;
  while (std::getline(iss, item, '"')) {
    tmp.push_back(item);
  }
}


Error: TLE

Fixed submission:

#include <iostream>
#include <sstream>
#include <string>

int main() {
  int cnt;
  bool odd;
  bool flag = false;
  std::string str1;
  std::string str2;
  std::string tmp1;
  std::string tmp2;
  std::string tmp3;
  while (true) {
    odd = false;
    std::cin >> str1;
    std::cin >> str2;
    cnt = 0;
    std::istringstream iss1(str1);
    std::istringstream iss2(str2);
    while (std::getline(iss1, tmp1, '"')) {
      if (std::getline(iss2, tmp3, '"')) {
        std::istringstream iss3(tmp3);
        iss3 >> tmp2;
        std::cout << tmp2 << "\\n";
        if (tmp2 == ".") {
          flag = true;
          break;
        }
        if (tmp1 != tmp2) {
          if (odd) {
            cnt++;
          } else {
            cnt += 2;
            break;
          }
        }
      } else {
        cnt += 2;
        break;
      }

      if (odd) {
        odd = false;
      } else {
        odd = true;
      }
    }
    if (flag) {
      break;
    }
    if (cnt == 0) {
      std::cout << "IDENTICAL\\n";
    } else if (cnt == 1) {
      std::cout << "CLOSE\\n";
    } else {
      std::cout << "DIFFERENT\\n";
    }
  }
}