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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: B = None
        self.o: D = None
        self.u: C = None
        self.z: B = None
        self.txt = txt

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

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

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

l = A("l")
k = B("k")
n = C("n")
c = D("c")
a = E("a")
b = B("b")

l.u = n
k.t = a
k.p = b
k.z = b
k.o = c
k.u = n
n.y = a
n.w = k
n.q = c
c.t = l
c.q = k
c.o = k
a.r = l
b.t = a
b.p = k
b.z = k
b.o = c
b.u = n
assert a.r.u.q.q.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: B = None
        self.o: D = None
        self.u: C = None
        self.z: B = None
        self.txt = txt

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

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

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

l = A("l")
k = B("k")
n = C("n")
c = D("c")
a = E("a")
b = B("b")

l.u = n
k.t = a
k.p = b
k.z = b
k.o = c
k.u = n
n.y = a
n.w = k
n.q = c
c.t = l
c.q = k
c.o = k
a.r = l
b.t = a
b.p = k
b.z = k
b.o = c
b.u = n
assert a.r.u.q.q.z.u.txt == "n"