class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: B = None
        self.r: B = None
        self.x: C = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: B = None
        self.w: B = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: B = None
        self.w: B = None
        self.s: E = None
        self.txt = txt

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

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

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

k.w = f
k.x = f
k.z = f
k.u = n
k.r = n
n.p = l
n.t = l
f.v = h
f.s = h
f.r = n
f.w = n
l.t = k
l.o = n
h.x = l
assert h.x.t.x.s.x.txt == "l"