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

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

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

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

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

m = A("m")
l = B("l")
h = C("h")
k = D("k")
j = E("j")
g = A("g")
e = D("e")

m.o = j
m.p = l
l.z = h
h.p = k
h.t = g
k.y = h
k.o = e
k.x = e
k.v = l
j.o = h
g.o = j
g.p = l
e.y = h
e.o = k
e.x = k
e.v = l
assert g.o.o.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: B = None
        self.txt = txt

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

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

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

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

m = A("m")
l = B("l")
h = C("h")
k = D("k")
j = E("j")
g = A("g")
e = D("e")

m.o = j
m.p = l
l.z = h
h.p = k
h.t = g
k.y = h
k.o = e
k.x = e
k.v = l
j.o = h
g.o = j
g.p = l
e.y = h
e.o = k
e.x = k
e.v = l
assert g.o.o.t.p.txt == "l"