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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

h = A("h")
d = B("d")
a = C("a")
f = D("f")
i = E("i")
b = A("b")
l = C("l")
j = C("j")
k = C("k")

h.t = i
h.p = j
h.z = a
h.o = l
d.o = j
a.o = d
a.x = b
f.v = h
i.p = k
i.q = h
b.t = i
b.p = k
b.z = l
b.o = j
l.o = d
l.x = h
j.o = d
j.x = b
k.o = d
k.x = b
assert a.o.o.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: C = None
        self.z: C = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

h = A("h")
d = B("d")
a = C("a")
f = D("f")
i = E("i")
b = A("b")
l = C("l")
j = C("j")
k = C("k")

h.t = i
h.p = j
h.z = a
h.o = l
d.o = j
a.o = d
a.x = b
f.v = h
i.p = k
i.q = h
b.t = i
b.p = k
b.z = l
b.o = j
l.o = d
l.x = h
j.o = d
j.x = b
k.o = d
k.x = b
assert a.o.o.x.p.txt == "k"