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

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

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

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

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

l = A("l")
h = B("h")
a = C("a")
j = D("j")
b = E("b")

l.x = h
l.u = h
l.v = a
l.z = b
h.z = j
h.s = j
h.o = b
h.v = a
a.q = l
j.s = h
j.y = h
j.x = b
j.r = l
j.v = a
b.o = l
b.y = l
b.x = h
assert a.q.z.o.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: C = None
        self.z: E = None
        self.u: B = None
        self.txt = txt

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

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

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

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

l = A("l")
h = B("h")
a = C("a")
j = D("j")
b = E("b")

l.x = h
l.u = h
l.v = a
l.z = b
h.z = j
h.s = j
h.o = b
h.v = a
a.q = l
j.s = h
j.y = h
j.x = b
j.r = l
j.v = a
b.o = l
b.y = l
b.x = h
assert a.q.z.o.v.q.txt == "l"