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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: C = None
        self.z: C = None
        self.s: C = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: C = None
        self.z: C = None
        self.s: C = None
        self.w: B = None
        self.txt = txt

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

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

f.o = n
f.w = h
f.t = h
f.x = h
f.u = i
k.z = n
n.u = i
n.p = k
n.y = h
i.u = k
i.w = k
i.p = n
i.z = n
i.s = n
h.p = f
assert k.z.p.z.y.txt == "h"