class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: D = None
        self.r: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: E = None
        self.q: A = None
        self.txt = txt

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

n.s = m
n.p = b
n.r = a
i.w = a
c.x = n
c.z = n
c.t = n
c.r = a
b.v = m
b.q = i
h.t = n
h.q = n
h.z = g
g.t = n
g.q = n
g.z = h
m.w = c
k.w = a
a.x = n
a.z = n
a.t = n
a.r = c
j.v = i
j.q = i
assert g.z.z.z.txt == "h"