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

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

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

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

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

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

n.u = j
n.o = j
n.p = l
b.t = j
b.w = j
b.v = n
b.z = n
j.o = m
j.v = k
m.w = n
m.t = b
k.v = b
l.w = n
l.t = b
assert k.v.v.u.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: C = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

n.u = j
n.o = j
n.p = l
b.t = j
b.w = j
b.v = n
b.z = n
j.o = m
j.v = k
m.w = n
m.t = b
k.v = b
l.w = n
l.t = b
assert k.v.v.u.v.v.txt == "b"