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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: C = None
        self.v: E = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: A = None
        self.o: E = None
        self.s: A = None
        self.txt = txt

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

c = A("c")
b = B("b")
d = C("d")
e = D("e")
f = E("f")
h = F("h")
g = G("g")
a = H("a")
i = A("i")

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: C = None
        self.v: E = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: A = None
        self.o: E = None
        self.s: A = None
        self.txt = txt

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

c = A("c")
b = B("b")
d = C("d")
e = D("e")
f = E("f")
h = F("h")
g = G("g")
a = H("a")
i = A("i")

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