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

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

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

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

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

k = A("k")
j = B("j")
n = C("n")
f = D("f")
h = E("h")

k.t = j
k.y = j
k.w = h
k.o = h
k.v = f
j.z = h
j.x = f
n.q = j
n.w = j
n.u = j
n.z = f
n.t = h
f.p = h
f.o = j
h.y = j
assert n.z.p.y.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: E = None
        self.v: D = None
        self.y: B = None
        self.o: E = None
        self.txt = txt

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

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

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

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

k = A("k")
j = B("j")
n = C("n")
f = D("f")
h = E("h")

k.t = j
k.y = j
k.w = h
k.o = h
k.v = f
j.z = h
j.x = f
n.q = j
n.w = j
n.u = j
n.z = f
n.t = h
f.p = h
f.o = j
h.y = j
assert n.z.p.y.z.y.txt == "j"