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

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

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

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

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

k = A("k")
n = B("n")
m = C("m")
e = D("e")
f = E("f")
l = D("l")

k.w = n
k.p = n
k.u = f
k.q = m
n.o = k
n.w = l
n.x = f
n.y = m
m.o = e
m.s = k
e.r = l
e.z = f
e.v = n
e.x = n
e.t = m
f.p = m
f.t = k
f.r = l
l.r = e
l.z = f
l.v = n
l.x = n
l.t = m
assert f.p.o.v.o.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: E = None
        self.q: C = None
        self.p: B = None
        self.txt = txt

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

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

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

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

k = A("k")
n = B("n")
m = C("m")
e = D("e")
f = E("f")
l = D("l")

k.w = n
k.p = n
k.u = f
k.q = m
n.o = k
n.w = l
n.x = f
n.y = m
m.o = e
m.s = k
e.r = l
e.z = f
e.v = n
e.x = n
e.t = m
f.p = m
f.t = k
f.r = l
l.r = e
l.z = f
l.v = n
l.x = n
l.t = m
assert f.p.o.v.o.u.p.txt == "m"