class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: C = None
        self.t: H = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: D = None
        self.u: D = None
        self.y: C = None
        self.v: C = None
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: I = None
        self.z: D = None
        self.x: E = None
        self.o: H = None
        self.p: I = None
        self.r: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: I = None
        self.o: D = None
        self.u: G = None
        self.y: G = None
        self.p: D = None
        self.z: B = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: H = None
        self.q: B = None
        self.x: I = None
        self.z: I = None
        self.v: B = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: I = None
        self.t: B = None
        self.r: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: C = None
        self.txt = txt

a = A("a")
k = B("k")
j = C("j")
h = D("h")
m = E("m")
e = F("e")
l = G("l")
d = H("d")
n = I("n")
b = D("b")

a.z = d
a.t = d
a.y = j
a.o = e
k.o = m
k.w = b
k.u = h
k.p = h
k.y = j
k.v = j
j.z = m
j.q = k
j.w = d
h.t = e
h.s = n
h.p = n
h.z = b
h.r = b
h.x = m
h.o = d
m.w = l
m.u = l
m.y = l
m.r = n
m.o = h
m.p = h
m.z = k
m.s = j
e.w = h
e.u = d
e.o = d
e.q = k
e.v = k
e.x = n
e.z = n
l.s = n
l.u = j
d.q = m
d.z = n
d.t = k
d.r = e
n.y = a
n.u = j
b.t = e
b.s = n
b.p = n
b.z = h
b.r = h
b.x = m
b.o = d
assert j.q.v.w.z.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: C = None
        self.t: H = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: D = None
        self.u: D = None
        self.y: C = None
        self.v: C = None
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: I = None
        self.z: D = None
        self.x: E = None
        self.o: H = None
        self.p: I = None
        self.r: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: I = None
        self.o: D = None
        self.u: G = None
        self.y: G = None
        self.p: D = None
        self.z: B = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: H = None
        self.q: B = None
        self.x: I = None
        self.z: I = None
        self.v: B = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: I = None
        self.t: B = None
        self.r: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: C = None
        self.txt = txt

a = A("a")
k = B("k")
j = C("j")
h = D("h")
m = E("m")
e = F("e")
l = G("l")
d = H("d")
n = I("n")
b = D("b")

a.z = d
a.t = d
a.y = j
a.o = e
k.o = m
k.w = b
k.u = h
k.p = h
k.y = j
k.v = j
j.z = m
j.q = k
j.w = d
h.t = e
h.s = n
h.p = n
h.z = b
h.r = b
h.x = m
h.o = d
m.w = l
m.u = l
m.y = l
m.r = n
m.o = h
m.p = h
m.z = k
m.s = j
e.w = h
e.u = d
e.o = d
e.q = k
e.v = k
e.x = n
e.z = n
l.s = n
l.u = j
d.q = m
d.z = n
d.t = k
d.r = e
n.y = a
n.u = j
b.t = e
b.s = n
b.p = n
b.z = h
b.r = h
b.x = m
b.o = d
assert j.q.v.w.z.u.w.txt == "d"