class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: B = None
        self.z: E = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

j.p = m
j.r = n
j.z = e
j.t = i
j.q = i
n.w = j
n.u = i
n.y = m
n.z = c
i.q = m
i.s = j
i.x = n
m.v = n
m.y = n
m.q = i
c.u = e
c.v = i
a.p = m
a.r = n
a.z = c
a.t = i
a.q = i
e.u = g
e.v = i
g.u = c
g.v = i
assert c.u.v.x.txt == "n"