#include<iostream>
#include<stdio.h>
#include<cmath>
#include<string>
 
#define EPS 1E-10
#define SAME_SIGN( a , b ) ( a * b > EPS ? true : false )

enum state {
	OVERLAP,
	JUST,
	NONE,
};
 
namespace geometry{
 
    struct point{
        double x;
        double y;
        point(){}
        point( double x , double y ):x(x),y(y){}
        point& operator += ( const point& p ){ x += p.x; y += p.y; return *this; }
        point& operator -= ( const point& p ){ x -= p.x; y -= p.y; return *this; }
        point& operator *= ( double factor ){ x *= factor; y *= factor; return *this; }
        point& operator /= ( double factor ){ x /= factor; y /= factor; return *this; }
        bool operator == ( const point& p ) const { return (std::abs(x - p.x) < EPS && std::abs(y - p.y) < EPS); }
        bool operator != ( const point& p ) const { return !(*this == p); }
        double norm() const{ return sqrt( pow( x , 2) + pow( y , 2 ) ); }
    };
 
    typedef point vector2d;
 
    struct circle{
        point center;
        double radius;
    };
 
    struct triangle{
        point a;
        point b;
        point c;
    };
 
    point operator + ( const point& p1 , const point& p2 ){
            point p(p1);
            p += p2;
            return p;
        }
        point operator - ( const point& p1 , const point& p2 ){
            point p(p1);
            p -= p2;
            return p;
        }
        point operator * ( const point& p1 , double factor ){
            point p(p1);
            p *= factor;
            return p;
        }
        point operator * ( double factor , const point& p1 ){
            point p(p1);
            p *= factor;
            return p;
        }
        point operator / ( const point& p1 , double factor ){
            point p(p1);
            p /= factor;
            return p;
        }
 
    std::istream& operator >> ( std::istream& s , point& p )
    {
        return s >> p.x >> p.y;
    }
 
    double get_distance( const point& p1 , const point& p2 )
    {
		double testDis = sqrt( pow( p1.x - p2.x , 2 ) + pow( p1.y - p2.y , 2 ) ); // テスト用
        return sqrt( pow( p1.x - p2.x , 2 ) + pow( p1.y - p2.y , 2 ) );
    }
 
    double get_dot_product( const point& a , const point& b , const point& o )
    {
        vector2d oa = a - o;
        vector2d ob = b - o;
        return oa.x * ob.x + oa.y * ob.y;
    }
 
    double get_cross_product( const point& a , const point& b , const point& o )
    {
        vector2d oa = a - o;
        vector2d ob = b - o;
        return oa.x * ob.y - oa.y * ob.x;
    }
 
    point get_project( const point& s , const point& e , const point& p ){
        double scale = get_dot_product( p , e , s ) / ( e - s ).norm();
        return s + scale * ( e - s ) / ( e - s ).norm();
    }
 
    bool is_inter_point( const point& s , const point& e , const point& p ){
        return std::abs(get_distance( s , p ) + get_distance( e , p ) - get_distance( s , e )) < EPS;
    }
}
 
using namespace geometry;
 
bool input_data( triangle& tri , circle& cir )
{
    std::cin >> tri.a;
    if( tri.a.x == 0 && tri.a.y == 0 ){
        return false;
    }
    std::cin >> tri.b;
    if( tri.b.x == 0 && tri.b.y == 0 ){
        return false;
    }
    std::cin >> tri.c;
    if( tri.c.x == 0 && tri.c.y == 0 ){
        return false;
    }
    std::cin >> cir.center;
    if( cir.center.x == 0 && cir.center.y == 0 ){
        return false;
    }
    std::cin >> cir.radius;
    return true;
}
 
state is_overlap_for_one_side( const point& p1 , const point& p2 , circle& cir )
{
	// 一つの辺と三角形が交差する場合にtrueを返す。
    if( is_inter_point( p1 , p2 , get_project( p1 , p2 , cir.center )) ){
		if( fabs(get_distance( get_project(p1 , p2 , cir.center ) , cir.center ) - cir.radius) < EPS ){
			return JUST;
		}
        if( get_distance( get_project( p1 , p2 , cir.center ) , cir.center ) < cir.radius ){
            return OVERLAP;
        }
        else{
            return NONE;
        }
    }
    else{
        return NONE;
    }
}
 
state is_overlap( triangle& tri , circle& cir )
{
    // オーバーラップなし、あるいは円が三角形に完全に含まれる場合にfalse
	/*
    if( !(is_overlap_for_one_side( tri.a , tri.b , cir )) &&
        !(is_overlap_for_one_side( tri.b , tri.c , cir )) &&
        !(is_overlap_for_one_side( tri.c , tri.a , cir ))
        ){
            return false;
    }
    else{
        return true;
    }
	*/
	if( is_overlap_for_one_side( tri.a , tri.b , cir ) == OVERLAP || 
		is_overlap_for_one_side( tri.b , tri.c , cir ) == OVERLAP ||
		is_overlap_for_one_side( tri.c , tri.a , cir ) == OVERLAP) {
		return OVERLAP;
	}
	else if( is_overlap_for_one_side( tri.a , tri.b , cir ) == NONE && 
			 is_overlap_for_one_side( tri.b , tri.c , cir ) == NONE &&
			 is_overlap_for_one_side( tri.c , tri.a , cir ) == NONE){
		return NONE;
	}
	else if(is_overlap_for_one_side( tri.a , tri.b , cir ) == JUST || 
			is_overlap_for_one_side( tri.b , tri.c , cir ) == JUST ||
			is_overlap_for_one_side( tri.c , tri.a , cir ) == JUST){
		return JUST;
	}
	else{
		std::cout << "error" << std::endl;
	}
 
}
 
void output_positional_relation_of_circle_and_triangle( triangle& tri , circle& cir )
{
    if( get_distance( tri.a , cir.center ) <= cir.radius  &&
        get_distance( tri.b , cir.center ) <= cir.radius  &&
        get_distance( tri.c , cir.center ) <= cir.radius
        ){
            std::cout << "b" << std::endl;
    }
    else{
        if( get_distance( tri.a , cir.center ) > cir.radius  &&
            get_distance( tri.b , cir.center ) > cir.radius  &&
            get_distance( tri.c , cir.center ) > cir.radius
            ){
                if( is_overlap( tri , cir ) == NONE ){
                    if( SAME_SIGN( get_cross_product( tri.a , tri.b , cir.center ) , get_cross_product( tri.b , tri.c , cir.center ) ) &&
                        SAME_SIGN( get_cross_product( tri.b , tri.c , cir.center ) , get_cross_product( tri.c , tri.a , cir.center ) )
                        ){
                            std::cout << "a" << std::endl;
                    }
                    else{
                        std::cout << "d" << std::endl;
                    }
                }
                else if( is_overlap( tri , cir ) == JUST ){
                   if( SAME_SIGN( get_cross_product( tri.a , tri.b , cir.center ) , get_cross_product( tri.b , tri.c , cir.center ) ) &&
                       SAME_SIGN( get_cross_product( tri.b , tri.c , cir.center ) , get_cross_product( tri.c , tri.a , cir.center ) )
                        ){
                            std::cout << "a" << std::endl;
                    }
                    else{
                        std::cout << "c" << std::endl;
                    }
                }
				else if( is_overlap( tri , cir ) == OVERLAP ){
					std::cout << "c" << std::endl;
				}
				else{
					std::cout << "error" << std::endl;
				}
        }
        else{
            std::cout << "c" << std::endl;
        }
    }
}

std::string output_positional_relation_of_circle_and_triangle_for_test( triangle& tri , circle& cir )
{
	 if( get_distance( tri.a , cir.center ) <= cir.radius  &&
        get_distance( tri.b , cir.center ) <= cir.radius  &&
        get_distance( tri.c , cir.center ) <= cir.radius
        ){
           return "b";
    }
    else{
        if( get_distance( tri.a , cir.center ) > cir.radius  &&
            get_distance( tri.b , cir.center ) > cir.radius  &&
            get_distance( tri.c , cir.center ) > cir.radius
            ){
                if( is_overlap( tri , cir ) == NONE ){
                    if( SAME_SIGN( get_cross_product( tri.a , tri.b , cir.center ) , get_cross_product( tri.b , tri.c , cir.center ) ) &&
                        SAME_SIGN( get_cross_product( tri.b , tri.c , cir.center ) , get_cross_product( tri.c , tri.a , cir.center ) )
                        ){
                            return "a";
                    }
                    else{
                        return "d";
                    }
                }
                else if( is_overlap( tri , cir ) == JUST ){
                   if( SAME_SIGN( get_cross_product( tri.a , tri.b , cir.center ) , get_cross_product( tri.b , tri.c , cir.center ) ) &&
                       SAME_SIGN( get_cross_product( tri.b , tri.c , cir.center ) , get_cross_product( tri.c , tri.a , cir.center ) )
                        ){
                            return "a";
                    }
                    else{
                        return "c";
                    }
                }
				else if( is_overlap( tri , cir ) == OVERLAP ){
					return "c";
				}
				else{
					std::cout << "error" << std::endl;
				}
        }
        else{
            return "c";
        }
    }
}

struct TEST_CASE {
	triangle tri;
	circle cir;
	std::string ans;

	void SetTestCase( int ax, int ay, int bx, int by, int cx, int cy, int ox, int oy, int r, std::string ans )
	{
		this->tri.a.x = ax;
		this->tri.a.y = ay;
		this->tri.b.x = bx;
		this->tri.b.y = by;
		this->tri.c.x = cx;
		this->tri.c.y = cy;
		this->cir.center.x = ox;
		this->cir.center.y = oy;
		this->cir.radius = r;
		this->ans = ans;
	}
};

void test(void)
{
	TEST_CASE testCase[100];

	testCase[0].SetTestCase(10, 20, 1, 5, 19, 5, 10, 10, 3, "a");
	testCase[1].SetTestCase(10, 12, 12, 9, 8, 9, 10, 10, 3, "b");
	testCase[2].SetTestCase(10, 12, 12, 9, 7, 10, 10, 10, 3, "b");
	testCase[3].SetTestCase(20, 5, 40, 20, 40, 5, 20, 20, 12, "c");
	testCase[4].SetTestCase(20, 5, 41, 20, 40, 5, 20, 20, 12, "d");
	testCase[5].SetTestCase(10, 13, 10, 16, 7, 13, 10, 10, 3, "c");
	testCase[6].SetTestCase(2000, 500, 4000, 2000, 4000, 500, 2000, 2000, 1200, "c");
	testCase[7].SetTestCase(2000, 500, 4001, 2000, 4000, 500, 2000, 2000, 1200, "d");
	testCase[8].SetTestCase(2000, 500, 3999, 2000, 4000, 500, 2000, 2000, 1200, "c");
	testCase[9].SetTestCase(1000, 2000, 100, 500, 1900, 500, 1000, 1000, 300, "a");
	testCase[10].SetTestCase(1000, 1200, 1200, 900, 800, 900, 1000, 1000, 300, "b");
	testCase[11].SetTestCase(1000, 1200, 1200, 900, 700, 1000, 1000, 1000, 300, "b");
	testCase[12].SetTestCase(1000, 1300, 1000, 1600, 700, 1300, 1000, 1000, 300, "c");
	testCase[13].SetTestCase(1, 4999, 9999, 4999, 5000, 9000, 5000, 5000, 1, "a");
	testCase[14].SetTestCase(1, 4999, 9999, 4999, 5000, 9000, 5000, 5001, 1, "a");
	testCase[15].SetTestCase(1, 4999, 9999, 5001, 5000, 9000, 5000, 5001, 1, "c");

	for( int i = 0 ; i < 16 ; i++ )
	{
		std::cout << "testCase[" << i << "] : ";
		if( testCase[i].ans == output_positional_relation_of_circle_and_triangle_for_test(testCase[i].tri, testCase[i].cir) ){
			std::cout << "OK" << std::endl;
		}
		else{
			std::cout << "NG" << std::endl;
		}
	}
}
 
int main(void)
{
    triangle tri;
    circle cir;
 
	// test();

    while(input_data(tri, cir)){
        output_positional_relation_of_circle_and_triangle( tri , cir );
    }
 
    return 0;
}

Measured memory_bytes: 1216