class A:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: D = None
        self.q: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: H = None
        self.s: I = None
        self.p: F = None
        self.v: G = None
        self.z: B = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: B = None
        self.o: A = None
        self.s: G = None
        self.w: I = None
        self.p: F = None
        self.v: A = None
        self.q: I = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: H = None
        self.s: I = None
        self.p: F = None
        self.v: G = None
        self.z: B = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: B = None
        self.o: A = None
        self.s: G = None
        self.w: I = None
        self.p: F = None
        self.v: A = None
        self.q: I = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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