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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: H = None
        self.v: G = None
        self.u: E = None
        self.t: F = None
        self.r: G = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: B = None
        self.v: A = None
        self.u: F = None
        self.r: A = None
        self.w: E = None
        self.z: I = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: G = None
        self.s: D = None
        self.q: D = None
        self.t: H = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: B = None
        self.y: B = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: I = None
        self.x: G = None
        self.y: B = None
        self.t: E = None
        self.p: I = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: D = None
        self.q: C = None
        self.t: B = None
        self.s: G = None
        self.r: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: H = None
        self.v: G = None
        self.u: E = None
        self.t: F = None
        self.r: G = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: B = None
        self.v: A = None
        self.u: F = None
        self.r: A = None
        self.w: E = None
        self.z: I = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: G = None
        self.s: D = None
        self.q: D = None
        self.t: H = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: B = None
        self.y: B = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: I = None
        self.x: G = None
        self.y: B = None
        self.t: E = None
        self.p: I = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: D = None
        self.q: C = None
        self.t: B = None
        self.s: G = None
        self.r: A = None
        self.txt = txt

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

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