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

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

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

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

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

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

k.o = a
k.s = c
m.o = b
m.z = a
m.t = a
m.p = k
m.v = k
f.o = k
f.v = k
f.q = a
f.z = c
a.v = c
c.o = b
c.z = k
c.w = f
b.o = k
b.v = k
b.q = a
b.z = c
j.o = k
j.v = k
j.q = a
j.z = c
assert f.o.s.o.z.o.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

k.o = a
k.s = c
m.o = b
m.z = a
m.t = a
m.p = k
m.v = k
f.o = k
f.v = k
f.q = a
f.z = c
a.v = c
c.o = b
c.z = k
c.w = f
b.o = k
b.v = k
b.q = a
b.z = c
j.o = k
j.v = k
j.q = a
j.z = c
assert f.o.s.o.z.o.z.z.txt == "k"