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

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

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

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

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

h = A("h")
k = B("k")
a = C("a")
d = D("d")
n = E("n")

h.y = d
h.t = d
h.q = k
k.z = n
k.s = n
k.t = n
k.w = a
k.v = a
a.y = d
a.v = d
a.o = n
d.w = n
d.o = h
d.r = a
n.x = k
n.v = d
assert d.r.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

h = A("h")
k = B("k")
a = C("a")
d = D("d")
n = E("n")

h.y = d
h.t = d
h.q = k
k.z = n
k.s = n
k.t = n
k.w = a
k.v = a
a.y = d
a.v = d
a.o = n
d.w = n
d.o = h
d.r = a
n.x = k
n.v = d
assert d.r.v.w.txt == "n"