class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: B = None
        self.s: E = None
        self.u: I = None
        self.y: H = None
        self.x: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.z: C = None
        self.p: H = None
        self.r: C = None
        self.y: F = None
        self.u: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: G = None
        self.t: A = None
        self.z: B = None
        self.y: A = None
        self.w: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.z: C = None
        self.p: H = None
        self.r: C = None
        self.y: F = None
        self.u: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: G = None
        self.t: A = None
        self.z: B = None
        self.y: A = None
        self.w: G = None
        self.txt = txt

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

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

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