class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: D = None
        self.y: B = None
        self.z: C = None
        self.txt = txt

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

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

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

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

l = A("l")
e = B("e")
a = C("a")
b = D("b")
k = E("k")
j = E("j")
c = D("c")
h = E("h")
m = C("m")

l.u = e
l.y = e
l.p = c
l.z = a
e.o = l
e.y = m
e.u = b
a.w = c
a.t = e
b.y = h
b.x = e
b.o = m
k.v = j
k.z = a
j.v = h
j.z = m
c.y = j
c.x = e
c.o = m
h.v = j
h.z = a
m.w = b
m.t = e
assert m.t.y.t.o.y.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: D = None
        self.y: B = None
        self.z: C = None
        self.txt = txt

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

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

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

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

l = A("l")
e = B("e")
a = C("a")
b = D("b")
k = E("k")
j = E("j")
c = D("c")
h = E("h")
m = C("m")

l.u = e
l.y = e
l.p = c
l.z = a
e.o = l
e.y = m
e.u = b
a.w = c
a.t = e
b.y = h
b.x = e
b.o = m
k.v = j
k.z = a
j.v = h
j.z = m
c.y = j
c.x = e
c.o = m
h.v = j
h.z = a
m.w = b
m.t = e
assert m.t.y.t.o.y.o.y.txt == "e"