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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: H = None
        self.u: D = None
        self.z: C = None
        self.y: G = None
        self.s: F = None
        self.w: G = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: G = None
        self.p: I = None
        self.q: B = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: D = None
        self.p: I = None
        self.v: B = None
        self.q: I = None
        self.u: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: H = None
        self.u: D = None
        self.z: C = None
        self.y: G = None
        self.s: F = None
        self.w: G = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: G = None
        self.p: I = None
        self.q: B = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: D = None
        self.p: I = None
        self.v: B = None
        self.q: I = None
        self.u: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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