#include <stdio.h>
#include <ctype.h>


int searchnext(FILE*f, const char*s)
{
  int c;
  fpos_t p;  fgetpos(f, &p);
  c = fgetc(f);  if (c == EOF) return 0;
  if (tolower((unsigned char)c) == tolower((unsigned char)*s))
  {
    if (!*++s) return 1;
    else
      return searchnext(f, s);
  }
  fsetpos(f, &p);
  return 0;
}

int searchfor(FILE*f, const char*s)
{
  int c;
  while ((c = fgetc(f)) != EOF)
  {
    if (tolower((unsigned char)c) == tolower((unsigned char)*s) && searchnext(f, s + 1)) return 1;
  }
  return 0;
}

int main(int argc,char**argv)
{
  return searchfor(stdin, argv[1]);
}
