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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: G = None
        self.w: J = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: J = None
        self.u: A = None
        self.q: E = None
        self.p: A = None
        self.y: A = None
        self.r: D = None
        self.z: C = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: J = None
        self.w: H = None
        self.y: B = None
        self.u: H = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: A = None
        self.q: J = None
        self.s: G = None
        self.r: A = None
        self.z: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: G = None
        self.w: J = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: J = None
        self.u: A = None
        self.q: E = None
        self.p: A = None
        self.y: A = None
        self.r: D = None
        self.z: C = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: J = None
        self.w: H = None
        self.y: B = None
        self.u: H = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: A = None
        self.q: J = None
        self.s: G = None
        self.r: A = None
        self.z: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: G = None
        self.txt = txt

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

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

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