Go: package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		buf0 := strings.Split(scanner.Text(), " ")
		input0 := make([]int, 2)
		for i := range input0 {
			input0[i], _ = strconv.Atoi(buf0[i])
		}
		if input0[0] == 0 && input0[1] == 0 {
			break
		}
		a, b := input0[0], input0[1]
		scanner.Scan()
		buf1 := strings.Split(scanner.Text(), " ")
		input1 := make([]int, 2)
		for i := range input1 {
			input1[i], _ = strconv.Atoi(buf1[i])
		}
		c, d := input1[0], input1[1]
		scanner.Scan()
		buf2 := strings.Split(scanner.Text(), " ")
		input2 := make([]int, 2)
		for i := range input2 {
			input2[i], _ = strconv.Atoi(buf2[i])
		}
		e, f := input2[0], input2[1]
		scanner.Scan()
		buf3 := strings.Split(scanner.Text(), " ")
		input3 := make([]int, 2)
		for i := range input3 {
			input3[i], _ = strconv.Atoi(buf3[i])
		}
		g, h := input3[0], input3[1]
		scanner.Scan()
		r, _ := strconv.Atoi(scanner.Text())
		if (a-g)*(a-g)+(b-h)*(b-h) <= r*r && (c-g)*(c-g)+(d-h)*(d-h) <= r*r && (e-g)*(e-g)+(f-h)*(f-h) <= r*r {
			fmt.Println("b")
		} else if dist(a, b, c, d, g, h) > float64(r)-0.000001 && dist(a, b, e, f, g, h) > float64(r)-0.000001 && dist(e, f, c, d, g, h) > float64(r)-0.000001 && inclusive(a, b, c, d, e, f, g, h) {
			fmt.Println("a")
		} else if CL_intersect(a, b, c, d, g, h, r) || CL_intersect(a, b, e, f, g, h, r) || CL_intersect(e, f, c, d, g, h, r) {
			fmt.Println("c")
		} else {
			fmt.Println("d")
		}
	}
}

func CL_intersect(ax, ay, bx, by, cx, cy, r int) bool {
	acx := cx - ax
	acy := cy - ay
	bcx := cx - bx
	bcy := cy - by
	abx := bx - ax
	aby := by - ay
	if acx*acx+acy*acy >= r*r || bcx*bcx+bcy*bcy >= r*r {
		if abx*acx+aby*acy < 0 {
			if acx*acx+acy*acy <= r*r {
				return true
			}
		} else {
			if abx*acx+aby*acy > abx*abx+aby*aby {
				if bcx*bcx+bcy*bcy <= r*r {
					return true
				}
			} else if acx*acx+acy*acy-(abx*acx+aby*acy)*(abx*acx+aby*acy)/(abx*abx+aby*aby) <= r*r {
				return true
			}
		}
	}
	return false
}

func inclusive(ax, ay, bx, by, cx, cy, px, py int) bool {
	ok1 := true
	ok2 := true
	if (bx-ax)*(py-ay)-(px-ax)*(by-ay) < 0 {
		ok1 = false
	}
	if (bx-ax)*(py-ay)-(px-ax)*(by-ay) > 0 {
		ok2 = false
	}
	if (cx-bx)*(py-by)-(px-bx)*(cy-by) < 0 {
		ok1 = false
	}
	if (cx-bx)*(py-by)-(px-bx)*(cy-by) > 0 {
		ok2 = false
	}
	if (ax-cx)*(py-cy)-(px-cx)*(ay-cy) < 0 {
		ok1 = false
	}
	if (ax-cx)*(py-cy)-(px-cx)*(ay-cy) > 0 {
		ok2 = false
	}
	return ok1 || ok2
}

func dist(ax, ay, bx, by, px, py int) float64 {
	dx := float64(bx - ax)
	dy := float64(by - ay)
	A := float64(dx*dx + dy*dy)
	B := dx*float64(ax-px) + dy*float64(ay-py)
	t := -B / A
	if t < 0 {
		t = 0
	}
	if t > 1 {
		t = 1
	}
	tx := float64(ax) + dx*t
	ty := float64(ay) + dy*t
	return math.Sqrt((float64(px)-tx)*(float64(px)-tx) + (float64(py)-ty)*(float64(py)-ty))
}

C++: #include<iostream>
#include<fstream>
#include<sstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
#include<cstdlib>
#include<climits>
#include<utility>
#include<cctype>
using namespace std;

#define ull unsigned long long
#define stt(it,order) sort(it.begin(),it.end(),order)
#define STT(it,n,order) sort(it,it+n,order)
#define st(it) sort(it.begin(),it.end())
#define ST(it,n) sort(it,it+n)
#define ll long long
#define rep(i,j) for(int i=0;i<j;++i)
#define loop(i,a,j) for(int i=a;i<j;++i)
#define mpi(it,table,T,E) for(map<T,E>::iterator it = table.begin();it!=table.end();++it)
#define PI 3.141592654
#define pb(v,e) v.push_back(e)
#define ms(a,v) memset(a,v,sizeof(a))
#define cp(a,b,n) rep(i,n)a[i] = b[i]
#define pi(a) printf("%d\n",a)
#define ps(a) printf("%s\n",a)
#define si(a) scanf("%d",&a)
#define print_int_matrix(mat,n) rep(i,n-1){printf("%d ",mat[i]);}printf("%d\n",mat[n-1]);
#define print_string_matrix(mat,n) rep(i,n-1){printf("%s ",mat[i]);}printf("%s\n",mat[n-1]);
#define mkp(a,b) make_pair(a,b)
#define fnd(table,e) (find(table.begin(),table.end(),e) != table.end())

//TYPOS DE DATOS PERSONALES
typedef unsigned int _set;
typedef unsigned long _lset;
typedef pair<int,int> pii;

string sint(int i){
   stringstream buf;
   buf<<i;
   return buf.str();
}

/*
ifstream fin("input.txt");
ofstream fout("output.txt");
#define cin fin
#define cout fout
*/

int dx[] = {-1,0,0,1};
int dy[] = {0,-1,1,0};
int dx8[] = {-1,-1,-1,0,0,1,1,1};
int dy8[] = {-1,0,1,-1,1,-1,0,1};

#define EPS (1e-10)

inline int cmp(const double& x, const double& y = 0, double tol = EPS){
     return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1;
}

double dis(pii vex,int a,int b){
   return sqrt( pow(vex.first-a,2) + pow(vex.second - b,2));
}

double dis(double x,double y,double u,double v){
   return sqrt( pow(x-u,2) + pow(y-v,2));
}

bool insd(double x,double a,double b){
   return min(a,b) <= x && x <= max(a,b);
}

bool inter(pii Pa, pii Pb, int x,int y,int r){

   int A = Pb.second - Pa.second;
   int B = Pa.first - Pb.first;
   int C = A*Pa.first + B*Pa.second;

   if( B == 0)return false;

   double neta = 2*A*B*y - 2*A*C - 2*B*B*x;
   double theta = B*B + A*A;
   double betha = B*B*x*x - r*r*B*B + y*y*B*B + C*C - 2*B*C*y;

   return neta*neta >= 4*theta*betha ;
}

bool perp(pii Pa,pii Pb,int x,int y,int r){
   int A = Pb.second - Pa.second;
   int B = Pa.first - Pb.first;
   int C = A*Pa.first + B*Pa.second;

   int D = -B;
   int E = A;
   int F = D*x + E*y;

   double det = A*E - B*D;
   double sx = (C*E-B*F)/det;
   double sy = (A*F-D*C)/det;

   return insd(sx,Pa.first,Pb.first) && insd(sy,Pa.second,Pb.second);

}

int main(){
   int a,b;
   while( scanf("%d %d",&a,&b) != EOF , a || b ){
      vector<pii> tri;
      pb(tri,mkp(a,b));

      scanf("%d %d",&a,&b);
      pb(tri,mkp(a,b));

      scanf("%d %d",&a,&b);
      pb(tri,mkp(a,b));

      scanf("%d %d",&a,&b);
      int r;
      si(r);

      int t = 0;

      rep(i,3){
         double d = dis(tri[i],a,b);
         if( cmp(d,r) <= 0){
            t++;
         }

      }

      if( t == 3){
         printf("b\n");
      }else{
         bool find = false;
         rep(i,3){
            find = find || inter(tri[i],tri[(i+1)%3],a,b,r);
         }
         if( find ){
            printf("c\n");
         }else{
            find = true;
            rep(i,3){
               find = find && perp(tri[i],tri[(i+1)%3],a,b,r);
            }

            if( find){
               printf("a\n");
            }else{
               printf("d\n");
            }

         }
      }

   }
   return 0;
}

C++: #include<stdio.h>
#include<algorithm>
using namespace std;
bool CL_intersect(int ax,int ay,int bx,int by,int cx,int cy,int r){
	int acx=cx-ax;
	int acy=cy-ay;
	int bcx=cx-bx;
	int bcy=cy-by;
	int abx=bx-ax;
	int aby=by-ay;
	if(acx*acx+acy*acy>=r*r||bcx*bcx+bcy*bcy>=r*r){
		if(abx*acx+aby*acy<0&&acx*acx+acy*acy<=r*r)return true;
		else if(abx*acx+aby*acy>abx*abx+aby*aby&&bcx*bcx+bcy*bcy<=r*r)return true;
		else if(acx*acx+acy*acy-(abx*acx+aby*acy)*(abx*acx+aby*acy)/(abx*abx+aby*aby)<=r*r)return true;
	}
	return false;
}
bool intersect(int ax,int ay,int bx,int by,int cx,int cy,int dx,int dy){
	long long ta=(cx-dx)*(ay-cy)+(cy-dy)*(cx-ax);
	long long tb=(cx-dx)*(by-cy)+(cy-dy)*(cx-bx);
	long long tc=(ax-bx)*(cy-ay)+(ay-by)*(ax-cx);
	long long td=(ax-bx)*(dy-ay)+(ay-by)*(ax-dx);
	if(ta*tb<=0LL&&tc*td<=0LL)return true;
	else return false;
}
int main(){
	int a,b,c,d,e,f,g,h,r;
	while(scanf("%d%d",&a,&b),a||b){
		scanf("%d%d%d%d%d%d%d",&c,&d,&e,&f,&g,&h,&r);
		if((a-g)*(a-g)+(b-h)*(b-h)<r*r&&(c-g)*(c-g)+(d-h)*(d-h)<r*r&&(e-g)*(e-g)+(f-h)*(f-h)<r*r)printf("b\n");
		else if(CL_intersect(a,b,c,d,g,h,r)||CL_intersect(a,b,e,f,g,h,r)||CL_intersect(e,f,c,d,g,h,r))printf("c\n");
		else if(intersect(g,h,a,b,c,d,e,f)||intersect(g,h,c,d,a,b,e,f)||intersect(g,h,e,f,a,b,c,d))printf("d\n");
		else printf("a\n");
	}
}