class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: C = None
        self.u: E = None
        self.q: E = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: G = None
        self.z: H = None
        self.o: C = None
        self.u: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: G = None
        self.o: D = None
        self.x: D = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: G = None
        self.t: B = None
        self.y: C = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: G = None
        self.z: H = None
        self.o: C = None
        self.u: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: G = None
        self.o: D = None
        self.x: D = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: G = None
        self.t: B = None
        self.y: C = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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