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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: B = None
        self.r: G = None
        self.u: C = None
        self.w: G = None
        self.y: I = None
        self.q: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: E = None
        self.v: B = None
        self.q: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: B = None
        self.r: G = None
        self.u: C = None
        self.w: G = None
        self.y: I = None
        self.q: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: E = None
        self.v: B = None
        self.q: H = None
        self.txt = txt

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

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

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

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