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 <vector>
#include <complex>	// require complex func
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

// deq notes ½Êô½É¨¯éxNgZ http://www.deqnotes.net/acmicpc/2d_geometry/
typedef complex<double> P;
#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b)) < EPS)
// àÏ (dot product) : a&#8901;b = |a||b|cosÆ
double dot(P a, P b) {
	return (a.real() * b.real() + a.imag() * b.imag());
}
// OÏ (cross product) : a~b = |a||b|sinÆ
double cross(P a, P b) {
	return (a.real() * b.imag() - a.imag() * b.real());
}
// _a,bð[_Æ·éüªÆ_cÆÌ£
double distance_ls_p(P a, P b, P c) {
  if ( dot(b-a, c-a) < EPS ) return abs(c-a);
  if ( dot(a-b, c-b) < EPS ) return abs(c-b);
  return abs(cross(b-a, c-a)) / abs(b-a);
}
struct T{
	P tp[3];
};
struct C{
	P cp;
	double r;
};

// ~ÌSªOp`ÉÜÜêé
bool is_cpint (T t, C c )
{
	vector <double> res (3, 0.0 );
	rep (i, 3 ){
		P A = t.tp[i], B = t.tp[(i+1) % 3], C = c.cp;
		res[i] = cross (B-A, C-A );
	} // end rep
	int plus = 0;
	rep (i, 3 ){
		if (res[i] > 0. || abs (res[i] ) < EPS ){
 			plus++;
		} // end if
	} // end rep

	return (plus == 3 || plus == 0 );
}

// ~ªOp`ÉÜÜêé
int is_cint (T t, C c )
{
	if (!is_cpint (t, c ) )
		return 0;

	int res = 0;
	rep (i, 3 ){
		P A = t.tp[i], B = t.tp[(i+1) % 3], C = c.cp;
		double d = distance_ls_p (A, B, C );
		if ( d > c.r || abs (d - c.r ) < EPS )
			res++;
	} // end rep

	return res;
}

// Op`ª~ÉÜÜêéê
int is_tinc (T t, C c )
{
	int res = 0;
	rep (i, 3 ){
		double d = abs (t.tp[i] - c.cp );
		if ( d < c.r || abs (d - c.r ) < EPS )
			res++;
	} // end rep
	
	return res;
}

// ~ªüªÆð··é
bool is_intersect (T t, C c )
{
	rep (i, 3 ){
		P A = t.tp[i], B = t.tp[(i+1) % 3], C = c.cp;
		double d = distance_ls_p (A, B, C );
		if ( d < c.r || abs (d - c.r ) < EPS )
			return true;
	} // end rep

	return false;	
}

int main()
{
	T t;
	C c;
	while (cin >> t.tp[0].real() >> t.tp[0].imag() && t.tp[0].real() != 0.0 && t.tp[0].imag() != 0.0 ){
		for (int i = 1; i < 3; i++ )
			cin >> t.tp[i].real() >> t.tp[i].imag();
		cin >> c.cp.real() >> c.cp.imag() >> c.r;

		int cint = is_cint (t, c );
		int tinc = is_tinc (t, c );
		if (cint == 3 ){	// ~ªOp`ÉÜÜêé	
			cout << 'a' << endl;
		}else 	
		if (tinc == 3 ){	// Op`ª~ÉÜÜêé
			cout << 'b' << endl;
		}else if (cint > 0 || tinc > 0 || is_intersect (t, c ) ){
			cout << 'c' << endl;
		}else{
			cout << 'd' << endl;
		} // end if
	} // end loop
		
	return 0;
}

C++: #include<bits/stdc++.h>
#define int long long
using namespace std;
int f(int k) { return k * k; }
signed main() {
	int x1, x2, x3, y1, y2, y3, xr, yr, r;
	while (cin >> x1 >> y1, x1, y1) {
		cin >> x2 >> y2;
		cin >> x3 >> y3;
		cin >> xr >> yr >> r;
		int i1 = f(x1 - xr) + f(y1 - yr) <= f(r);
		int i2 = f(x2 - xr) + f(y2 - yr) <= f(r);
		int i3 = f(x3 - xr) + f(y3 - yr) <= f(r);
		int tc = (
			((y1 - y2) * xr - (x1 - x2) * yr + x1 * y2 - x2 * y1) * ((y1 - y2) * x3 - (x1 - x2) * y3 + x1 * y2 - x2 * y1) >= 0 &&
			((y2 - y3) * xr - (x2 - x3) * yr + x2 * y3 - x3 * y2) * ((y2 - y3) * x1 - (x2 - x3) * y1 + x2 * y3 - x3 * y2) >= 0 &&
			((y3 - y1) * xr - (x3 - x1) * yr + x3 * y1 - x1 * y3) * ((y3 - y1) * x2 - (x3 - x1) * y2 + x3 * y1 - x1 * y3) >= 0);

		int p12 = (f((y1 - y2) * xr - (x1 - x2) * yr + x1 * y2 - x2 * y1) < f(r) * (f(y1 - y2) + f(x1 - x2)) && ((x1 - x2) * (xr - x1) + (y1 - y2) * (yr - y1)) * ((x1 - x2) * (xr - x2) + (y1 - y2) * (yr - y2)) <= 0);
		int p23 = (f((y2 - y3) * xr - (x2 - x3) * yr + x2 * y3 - x3 * y2) < f(r) * (f(y2 - y3) + f(x2 - x3)) && ((x2 - x3) * (xr - x2) + (y2 - y3) * (yr - y2)) * ((x2 - x3) * (xr - x3) + (y2 - y3) * (yr - y3)) <= 0);
		int p31 = (f((y3 - y1) * xr - (x3 - x1) * yr + x3 * y1 - x1 * y3) < f(r) * (f(y3 - y1) + f(x3 - x1)) && ((x3 - x1) * (xr - x3) + (y3 - y1) * (yr - y3)) * ((x3 - x1) * (xr - x1) + (y3 - y1) * (yr - y1)) <= 0);
		int ps12 = (f((y1 - y2) * xr - (x1 - x2) * yr + x1 * y2 - x2 * y1) <= f(r) * (f(y1 - y2) + f(x1 - x2)) && ((x1 - x2) * (xr - x1) + (y1 - y2) * (yr - y1)) * ((x1 - x2) * (xr - x2) + (y1 - y2) * (yr - y2)) <= 0);
		int ps23 = (f((y2 - y3) * xr - (x2 - x3) * yr + x2 * y3 - x3 * y2) <= f(r) * (f(y2 - y3) + f(x2 - x3)) && ((x2 - x3) * (xr - x2) + (y2 - y3) * (yr - y2)) * ((x2 - x3) * (xr - x3) + (y2 - y3) * (yr - y3)) <= 0);
		int ps31 = (f((y3 - y1) * xr - (x3 - x1) * yr + x3 * y1 - x1 * y3) <= f(r) * (f(y3 - y1) + f(x3 - x1)) && ((x3 - x1) * (xr - x3) + (y3 - y1) * (yr - y3)) * ((x3 - x1) * (xr - x1) + (y3 - y1) * (yr - y1)) <= 0);
		/*cout << "i1: " << i1 << endl;
		cout << "i2: " << i2 << endl;
		cout << "i3: " << i3 << endl;
		cout << "tc: " << tc << endl;
		cout << "p12: " << p12 << endl;
		cout << "p23: " << p23 << endl;
		cout << "p31: " << p31 << endl;*/
		if (i1 + i2 + i3 == 3)printf("b\n");
		else if (i1 + i2 + i3 > 0)printf("c\n");
		else if (p12 + p23 + p31 > 0)printf("c\n");
		else if (tc)printf("a\n");
		else if (ps12 + ps23 + ps31 > 0)printf("c\n");
		else printf("d\n");
	}
}