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

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

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

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

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

n = A("n")
h = B("h")
m = C("m")
j = D("j")
i = E("i")
g = B("g")
k = C("k")
d = E("d")
f = D("f")
c = C("c")

n.y = j
n.z = k
n.w = c
h.v = k
h.p = i
h.s = f
h.o = m
m.t = j
j.u = f
j.q = f
j.s = i
i.r = k
i.v = n
i.x = n
i.w = d
g.v = k
g.o = k
g.p = i
g.s = j
k.t = f
d.r = k
d.v = n
d.x = n
d.w = i
f.u = j
f.q = j
f.s = d
c.t = f
assert h.s.q.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: C = None
        self.w: C = None
        self.txt = txt

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

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

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

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

n = A("n")
h = B("h")
m = C("m")
j = D("j")
i = E("i")
g = B("g")
k = C("k")
d = E("d")
f = D("f")
c = C("c")

n.y = j
n.z = k
n.w = c
h.v = k
h.p = i
h.s = f
h.o = m
m.t = j
j.u = f
j.q = f
j.s = i
i.r = k
i.v = n
i.x = n
i.w = d
g.v = k
g.o = k
g.p = i
g.s = j
k.t = f
d.r = k
d.v = n
d.x = n
d.w = i
f.u = j
f.q = j
f.s = d
c.t = f
assert h.s.q.s.r.txt == "k"