#include int f(int x) { return (x+4)%8; } int g(int x) { return (x+4)&7; } int main() { int i; for(i=0;i<8;i++) printf("%d %d %d\n",i,f(i),g(i)); return 0; }