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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.r: A = None
        self.w: G = None
        self.q: G = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.r: A = None
        self.w: G = None
        self.q: G = None
        self.t: C = None
        self.txt = txt

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

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

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