#include <stdio.h>
#include <string.h>

static int abs(int n)
{
  if (n < 0) return -1;
  if (n > 0) return  1;
  return 0;
}

int main()
{
  int i;

  for (i = 0; i < 5; i++) {
    printf("%d\n", abs(strncmp("abc", "abc", i)));
    printf("%d\n", abs(strncmp("abc", "ABC", i)));
    printf("%d\n", abs(strncmp("ABC", "abc", i)));
    printf("%d\n", abs(strncmp("a", "aaa", i)));
    printf("%d\n", abs(strncmp("aaa", "a", i)));
    printf("%d\n", abs(strncmp("aaaa", "abcd", i)));
    printf("%d\n", abs(strncmp("abcd", "aaaa", i)));
    printf("%d\n", abs(strncmp("012", "0123", i)));
    printf("%d\n", abs(strncmp("0123", "012", i)));
  }

  return 0;
}
