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

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

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

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

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

c = A("c")
b = B("b")
j = C("j")
f = D("f")
k = E("k")
e = E("e")
g = C("g")
l = A("l")

c.u = j
c.p = l
c.q = b
b.w = f
j.w = c
f.q = l
f.o = g
f.w = j
f.u = j
f.z = k
k.v = e
e.v = k
g.w = c
l.u = g
l.p = c
l.q = b
assert e.v.v.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: A = None
        self.q: B = None
        self.txt = txt

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

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

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

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

c = A("c")
b = B("b")
j = C("j")
f = D("f")
k = E("k")
e = E("e")
g = C("g")
l = A("l")

c.u = j
c.p = l
c.q = b
b.w = f
j.w = c
f.q = l
f.o = g
f.w = j
f.u = j
f.z = k
k.v = e
e.v = k
g.w = c
l.u = g
l.p = c
l.q = b
assert e.v.v.v.v.v.v.txt == "e"