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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: G = None
        self.u: H = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: F = None
        self.u: J = None
        self.v: J = None
        self.z: B = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: C = None
        self.r: H = None
        self.p: A = None
        self.z: F = None
        self.t: E = None
        self.s: J = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: H = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: I = None
        self.y: J = None
        self.r: A = None
        self.q: C = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: A = None
        self.x: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: A = None
        self.r: A = None
        self.txt = txt

g = A("g")
m = B("m")
h = C("h")
i = D("i")
f = E("f")
e = F("e")
k = G("k")
c = H("c")
j = I("j")
l = J("l")

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: G = None
        self.u: H = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: F = None
        self.u: J = None
        self.v: J = None
        self.z: B = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: C = None
        self.r: H = None
        self.p: A = None
        self.z: F = None
        self.t: E = None
        self.s: J = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: H = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: I = None
        self.y: J = None
        self.r: A = None
        self.q: C = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: A = None
        self.x: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: A = None
        self.r: A = None
        self.txt = txt

g = A("g")
m = B("m")
h = C("h")
i = D("i")
f = E("f")
e = F("e")
k = G("k")
c = H("c")
j = I("j")
l = J("l")

g.z = m
m.w = i
m.z = k
m.u = c
m.p = e
h.r = e
h.s = e
h.u = l
h.v = l
h.z = m
h.y = m
i.u = e
i.z = e
i.w = h
i.r = c
i.p = g
i.t = f
i.x = f
i.s = l
f.x = k
e.w = g
e.s = c
e.y = f
k.w = j
k.y = l
k.r = g
k.q = h
k.u = c
c.z = f
j.w = k
j.z = g
j.x = i
l.p = k
l.w = g
l.r = g
assert g.z.z.u.z.x.txt == "k"