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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: D = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.o: F = None
        self.w: I = None
        self.z: D = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: G = None
        self.w: F = None
        self.o: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: I = None
        self.t: G = None
        self.r: G = None
        self.p: I = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: F = None
        self.o: C = None
        self.q: E = None
        self.v: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: D = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.o: F = None
        self.w: I = None
        self.z: D = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: G = None
        self.w: F = None
        self.o: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: I = None
        self.t: G = None
        self.r: G = None
        self.p: I = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: F = None
        self.o: C = None
        self.q: E = None
        self.v: H = None
        self.txt = txt

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

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