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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: A = None
        self.y: A = None
        self.r: E = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.q: C = None
        self.v: D = None
        self.u: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: A = None
        self.y: A = None
        self.r: E = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.q: C = None
        self.v: D = None
        self.u: C = None
        self.txt = txt

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

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

k.o = c
k.v = f
b.p = k
n.w = k
n.u = k
n.y = k
n.o = k
n.r = l
c.y = l
c.p = l
c.q = m
c.u = m
c.v = a
l.w = a
f.y = l
f.p = l
f.q = n
f.v = a
f.u = m
m.w = k
m.u = k
m.y = k
m.o = k
m.r = l
a.y = l
a.p = l
a.q = n
a.v = f
a.u = m
assert f.u.r.w.p.w.txt == "a"