#include <bits/stdc++.h>
int main(void) {
  int a;
  while (scanf("%d", &a), a) {
    if (getchar() == ' ') {
      a = getchar();
      if (a == '\n') return 1;
      if (isupper(a))
        while (1)
          ;
      if (a == ' ') {
        puts("foo");
        return 0;
      }
    }
    scanf(" %*c %*c %*c");
  }
  return 0;
}
