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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: B = None
        self.r: G = None
        self.z: A = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: F = None
        self.txt = txt

g = A("g")
a = B("a")
c = C("c")
e = D("e")
l = E("l")
m = F("m")
d = G("d")
k = D("k")
i = D("i")
j = E("j")

g.z = a
a.z = i
a.u = g
c.o = a
c.x = m
c.y = j
c.t = g
e.z = m
e.x = m
e.t = j
e.w = l
e.p = a
e.r = k
l.t = c
l.x = a
l.z = e
m.p = c
m.x = a
m.r = d
m.z = g
m.q = g
d.s = l
d.z = m
k.z = m
k.x = m
k.t = j
k.w = l
k.p = a
k.r = e
i.z = m
i.x = m
i.t = j
i.w = j
i.p = a
i.r = e
j.t = c
j.x = a
j.z = k
assert k.r.w.z.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: B = None
        self.r: G = None
        self.z: A = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: F = None
        self.txt = txt

g = A("g")
a = B("a")
c = C("c")
e = D("e")
l = E("l")
m = F("m")
d = G("d")
k = D("k")
i = D("i")
j = E("j")

g.z = a
a.z = i
a.u = g
c.o = a
c.x = m
c.y = j
c.t = g
e.z = m
e.x = m
e.t = j
e.w = l
e.p = a
e.r = k
l.t = c
l.x = a
l.z = e
m.p = c
m.x = a
m.r = d
m.z = g
m.q = g
d.s = l
d.z = m
k.z = m
k.x = m
k.t = j
k.w = l
k.p = a
k.r = e
i.z = m
i.x = m
i.t = j
i.w = j
i.p = a
i.r = e
j.t = c
j.x = a
j.z = k
assert k.r.w.z.w.x.txt == "a"