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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: F = None
        self.u: B = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: H = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.r: E = None
        self.x: E = None
        self.p: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: F = None
        self.u: B = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: H = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.r: E = None
        self.x: E = None
        self.p: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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