class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: D = None
        self.r: C = None
        self.z: D = None
        self.u: A = None
        self.txt = txt

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

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

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

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

a = A("a")
e = B("e")
g = C("g")
n = D("n")
d = E("d")
i = C("i")
k = E("k")
m = D("m")
f = A("f")

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

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

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

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

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

a = A("a")
e = B("e")
g = C("g")
n = D("n")
d = E("d")
i = C("i")
k = E("k")
m = D("m")
f = A("f")

a.x = k
a.s = m
a.r = g
a.z = n
a.u = f
e.q = f
g.q = k
g.s = k
g.z = e
g.t = a
n.w = i
n.v = i
n.t = a
n.z = m
n.x = e
d.u = m
d.p = i
i.q = k
i.s = k
i.z = e
i.t = f
k.u = m
k.p = g
m.w = g
m.v = g
m.t = a
m.z = n
m.x = e
f.x = k
f.s = n
f.r = g
f.z = m
f.u = a
assert g.z.q.u.txt == "a"