class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: H = None
        self.v: D = None
        self.z: E = None
        self.x: I = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: E = None
        self.q: E = None
        self.w: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: I = None
        self.p: F = None
        self.x: H = None
        self.t: A = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: H = None
        self.v: A = None
        self.u: G = None
        self.w: I = None
        self.p: H = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: H = None
        self.v: D = None
        self.z: E = None
        self.x: I = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: E = None
        self.q: E = None
        self.w: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: I = None
        self.p: F = None
        self.x: H = None
        self.t: A = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: H = None
        self.v: A = None
        self.u: G = None
        self.w: I = None
        self.p: H = None
        self.txt = txt

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

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

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

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

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