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

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

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

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

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

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

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

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

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

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

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

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

j.x = i
j.y = h
j.q = h
j.t = n
j.z = l
i.z = h
i.t = h
i.o = g
i.w = g
i.r = j
n.p = g
n.z = g
n.x = l
n.u = l
h.p = j
h.v = n
h.t = l
h.z = a
h.r = g
l.w = n
l.x = h
l.z = g
l.y = a
g.w = n
g.x = a
g.z = l
g.y = h
a.p = j
a.v = n
a.t = g
a.r = g
a.z = h
k.z = h
k.t = h
k.o = l
k.w = l
k.r = j
assert g.x.v.z.txt == "g"