class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: D = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: A = None
        self.t: E = None
        self.p: E = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: E = None
        self.u: E = None
        self.x: C = None
        self.w: E = None
        self.o: E = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: C = None
        self.w: F = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: B = None
        self.t: F = None
        self.txt = txt

n = A("n")
i = B("i")
h = C("h")
b = D("b")
a = E("a")
f = F("f")
c = G("c")
g = C("g")

n.t = c
n.u = b
n.p = g
n.w = g
i.r = b
h.y = c
h.o = n
h.t = a
h.p = a
h.q = a
b.t = n
b.y = a
b.u = a
b.w = a
b.o = a
b.x = g
b.s = i
a.o = i
a.x = h
a.w = f
a.v = g
f.w = n
c.r = n
c.x = i
c.t = f
g.y = c
g.o = n
g.t = a
g.p = a
g.q = a
assert c.t.w.u.t.w.t.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: D = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: A = None
        self.t: E = None
        self.p: E = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: E = None
        self.u: E = None
        self.x: C = None
        self.w: E = None
        self.o: E = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: C = None
        self.w: F = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: B = None
        self.t: F = None
        self.txt = txt

n = A("n")
i = B("i")
h = C("h")
b = D("b")
a = E("a")
f = F("f")
c = G("c")
g = C("g")

n.t = c
n.u = b
n.p = g
n.w = g
i.r = b
h.y = c
h.o = n
h.t = a
h.p = a
h.q = a
b.t = n
b.y = a
b.u = a
b.w = a
b.o = a
b.x = g
b.s = i
a.o = i
a.x = h
a.w = f
a.v = g
f.w = n
c.r = n
c.x = i
c.t = f
g.y = c
g.o = n
g.t = a
g.p = a
g.q = a
assert c.t.w.u.t.w.t.o.r.txt == "b"