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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: E = None
        self.z: B = None
        self.v: D = None
        self.txt = txt

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

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

e = A("e")
h = B("h")
c = C("c")
d = D("d")
n = E("n")
g = B("g")
b = D("b")
k = A("k")

e.t = g
e.u = n
e.r = n
e.o = c
e.x = c
h.t = c
h.p = n
h.s = n
c.y = e
c.q = n
c.z = h
c.v = b
d.p = c
d.r = g
n.t = b
g.t = c
g.p = n
g.s = n
b.p = c
b.r = g
k.t = g
k.u = n
k.r = n
k.o = c
k.x = c
assert k.t.p.t.p.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: E = None
        self.o: C = None
        self.x: C = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: E = None
        self.z: B = None
        self.v: D = None
        self.txt = txt

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

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

e = A("e")
h = B("h")
c = C("c")
d = D("d")
n = E("n")
g = B("g")
b = D("b")
k = A("k")

e.t = g
e.u = n
e.r = n
e.o = c
e.x = c
h.t = c
h.p = n
h.s = n
c.y = e
c.q = n
c.z = h
c.v = b
d.p = c
d.r = g
n.t = b
g.t = c
g.p = n
g.s = n
b.p = c
b.r = g
k.t = g
k.u = n
k.r = n
k.o = c
k.x = c
assert k.t.p.t.p.q.t.txt == "b"