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

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

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

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

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

k = A("k")
d = B("d")
g = C("g")
a = D("a")
n = E("n")
e = B("e")
l = A("l")

k.w = n
d.z = a
d.v = e
g.o = l
g.t = n
g.q = a
a.y = d
a.x = n
n.q = e
n.y = e
n.o = e
n.u = a
e.z = a
e.v = d
l.w = n
assert a.y.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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

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

k = A("k")
d = B("d")
g = C("g")
a = D("a")
n = E("n")
e = B("e")
l = A("l")

k.w = n
d.z = a
d.v = e
g.o = l
g.t = n
g.q = a
a.y = d
a.x = n
n.q = e
n.y = e
n.o = e
n.u = a
e.z = a
e.v = d
l.w = n
assert a.y.v.v.txt == "d"