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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: E = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: C = None
        self.z: C = None
        self.txt = txt

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

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

l.o = m
l.v = h
k.s = l
k.u = l
k.v = j
b.s = m
b.t = m
b.o = m
h.x = l
h.q = b
h.z = b
j.t = l
m.t = l
e.s = m
e.t = j
e.o = j
assert b.s.t.v.q.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: E = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: C = None
        self.z: C = None
        self.txt = txt

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

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

l.o = m
l.v = h
k.s = l
k.u = l
k.v = j
b.s = m
b.t = m
b.o = m
h.x = l
h.q = b
h.z = b
j.t = l
m.t = l
e.s = m
e.t = j
e.o = j
assert b.s.t.v.q.o.t.txt == "l"