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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: G = None
        self.u: H = None
        self.q: G = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: C = None
        self.p: H = None
        self.o: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: G = None
        self.u: H = None
        self.q: G = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: C = None
        self.p: H = None
        self.o: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: E = None
        self.txt = txt

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

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

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