class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: C = None
        self.r: D = None
        self.o: E = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: E = None
        self.v: B = None
        self.s: B = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: E = None
        self.r: B = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: D = None
        self.t: C = None
        self.txt = txt

c = A("c")
h = B("h")
e = C("e")
n = D("n")
a = E("a")
g = D("g")
m = B("m")
f = B("f")

c.t = n
c.q = e
c.z = e
c.r = g
c.o = a
h.y = m
h.v = m
h.s = m
h.t = a
h.q = e
e.p = n
e.q = a
e.u = a
e.r = h
n.t = a
a.u = n
a.v = g
a.t = e
g.t = a
m.y = h
m.s = h
m.t = a
m.v = f
m.q = e
f.y = h
f.v = h
f.t = a
f.s = m
f.q = e
assert e.r.q.p.t.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: C = None
        self.r: D = None
        self.o: E = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: E = None
        self.v: B = None
        self.s: B = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: E = None
        self.r: B = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: D = None
        self.t: C = None
        self.txt = txt

c = A("c")
h = B("h")
e = C("e")
n = D("n")
a = E("a")
g = D("g")
m = B("m")
f = B("f")

c.t = n
c.q = e
c.z = e
c.r = g
c.o = a
h.y = m
h.v = m
h.s = m
h.t = a
h.q = e
e.p = n
e.q = a
e.u = a
e.r = h
n.t = a
a.u = n
a.v = g
a.t = e
g.t = a
m.y = h
m.s = h
m.t = a
m.v = f
m.q = e
f.y = h
f.v = h
f.t = a
f.s = m
f.q = e
assert e.r.q.p.t.t.q.txt == "a"