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 <complex>
#include <vector>
#include <algorithm>

#define EPS 1e-8

using namespace std;

typedef complex<double> P; 
typedef vector<P> G;

double cross(const P &a, const P &b){
    return imag(conj(a)*b);
}

double dot(const P &a, const P &b){
    return real(conj(a) * b);
}

struct L : public vector<P> {
    L(const P &a, const P &b){
        push_back(a);
        push_back(b);
    }
    L(){}
};

struct C{
    P p;
    double r;
    C(const P &p, double r) : p(p), r(r) { }
    C(){}
};

bool intersectSP(const L &s, const P &p) {
    return abs(s[0]-p)+abs(s[1]-p)-abs(s[1]-s[0]) < EPS; // triangle inequality
}

P projection(const L &l, const P &p) {
  double t = dot(p-l[0], l[0]-l[1]) / norm(l[0]-l[1]);
  return l[0] + t*(l[0]-l[1]);
}

double distanceSP(const L &s, const P &p) {
  const P r = projection(s, p);
  if (intersectSP(s, r)) return abs(r - p);
  return min(abs(s[0] - p), abs(s[1] - p));
}

#define curr(G, i) G[i]
#define next(G, i) G[(i+1)%G.size()]
enum { OUT, ON, IN };
int contains(const G &g, const P &p) {
    bool in = false;
    for (int i = 0; i < g.size(); ++i) {
        P a = curr(g,i) - p, b = next(g,i) - p;
        if (imag(a) > imag(b)) swap(a, b);
        if (imag(a) <= 0 && 0 < imag(b))
            if (cross(a, b) < 0) in = !in;
        if (cross(a, b) == 0 && dot(a, b) <= 0) return ON;
    }
    return in ? IN : OUT;
}

int main(){
    int tmpx, tmpy,r;
    while(cin >> tmpx >> tmpy){
        if((tmpx | tmpy) == 0) break;
        G v(3);
        L *e = new L[3];
        C c;
        v[0] = P(tmpx, tmpy);
        cin >> tmpx >> tmpy;
        v[1] = P(tmpx, tmpy);
        cin >> tmpx >> tmpy;
        v[2] = P(tmpx, tmpy);
        e[0] = L(v[0],v[1]);
        e[1] = L(v[0],v[2]);
        e[2] = L(v[1],v[2]);
        cin >> tmpx >> tmpy >> r;
        c = C(P(tmpx,tmpy), r);
        //a:T contains C
        bool isA = true;
        for(int i=0;i<3;i++){
            //for all edges
            if(distanceSP(e[i], c.p) < r){
                isA = false;
            }
        }
        if(isA && contains(v, c.p) == IN){
            cout << "a" << endl;
            continue;
        }
        //b:C contains T
        bool isB = true;
        for(int i=0;i<3;i++){
            //for all vertex
            if(abs(v[i] - c.p) > r){
                isB = false;
            }
        }
        if(isB){
            cout << "b" << endl;
            continue;
        }
        bool isC = false;
        for(int i=0;i<3;i++){
            if(distanceSP(e[i]. c.p) <= r){
                isC = true;
            }
        }
        if(isC){
            cout << "c" << endl;
        }else{
            cout << "d" << endl;
        }
    }
}

C++: #include <iostream>
#include <cmath>

using namespace std;

typedef class Point
{
public:
	int x, y;
	Point() : x(0), y(0) {}
	Point(int x, int y) : x(x), y(y) {}
	
	double length()
	{
		return sqrt((double)(x*x + y*y));
	}
	
	Point operator - (const Point& p) const
	{
		return Point(x -p.x, y-p.y);
	}
} P;

typedef struct Triangle
{
	P p1, p2, p3;
} T;

typedef struct Circle
{
	P p;
	int r;
} C;

T t;
C c;

double cross(P p1, P p2)
{
	return (double)(p1.x * p2.y - p2.x * p1.y);
}

double dist(P p1, P p2)
{
	int dx = p1.x - p2.x;
	int dy = p1.y - p2.y;
	double ans = sqrt((double)(dx*dx + dy*dy));
	return ans;
}

double ldist(P p, P e1, P e2)
{
	return abs(cross(p-e1, e2-e1)) / (e2-e1).length();
}

bool included(P p, T t)
{
	double c1 = cross(t.p1 - p, t.p2 - p);
	double c2 = cross(t.p2 - p, t.p3 - p);
	double c3 = cross(t.p3 - p, t.p1 - p);
	if(c1 > 0 && c2 > 0 && c3 > 0) return true;
	if(c1 < 0 && c2 < 0 && c3 < 0) return true;
	
	return false;
}

void solve()
{
	double d1 = dist(t.p1, c.p);
	double d2 = dist(t.p2, c.p);
	double d3 = dist(t.p3, c.p);
	double ld1 = ldist(c.p, t.p1, t.p2);
	double ld2 = ldist(c.p, t.p2, t.p3);
	double ld3 = ldist(c.p, t.p3, t.p1);
	
	if(d1 < c.r && d2 < c.r && d3 < c.r)
	{
		cout << "b" << endl;
	}
	else if(ld1 <= c.r || ld2 <= c.r || ld3 <= c.r)
	{
		cout << "c" << endl;
	}
	else if(included(c.p, t))
	{
		cout << "a" << endl;
	}
	else
	{
		cout << "d" << endl;
	}
}

int main(int argc, char** argv)
{
	int x, y, r;
	
	while( 1 )
	{
		cin >> x >> y;
		if(!x && !y) break;		
		t.p1 =P(x, y);
		
		cin >> x>> y;
		t.p2 =P(x, y);
		
		cin >> x >> y;
		t.p3 = P(x, y);
		
		cin >> x >> y >> r;
		c.p =P(x, y);
		c.r = r;
		
		solve();
	}
}