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

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

class C:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: A = None
        self.s: B = None
        self.z: C = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: D = None
        self.y: G = None
        self.u: C = None
        self.q: D = None
        self.txt = txt

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

m = A("m")
h = B("h")
e = C("e")
l = D("l")
d = E("d")
k = F("k")
g = G("g")
j = D("j")
i = C("i")

m.u = l
h.v = d
h.u = i
e.v = i
e.z = i
e.o = m
e.s = h
e.t = k
l.q = i
d.o = g
d.t = i
d.w = e
d.v = m
k.z = h
k.o = j
k.y = g
k.u = e
k.q = l
g.r = d
g.t = m
g.u = l
g.w = k
g.x = k
j.q = i
i.v = e
i.z = e
i.o = m
i.s = h
i.t = k
assert j.q.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: A = None
        self.s: B = None
        self.z: C = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: D = None
        self.y: G = None
        self.u: C = None
        self.q: D = None
        self.txt = txt

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

m = A("m")
h = B("h")
e = C("e")
l = D("l")
d = E("d")
k = F("k")
g = G("g")
j = D("j")
i = C("i")

m.u = l
h.v = d
h.u = i
e.v = i
e.z = i
e.o = m
e.s = h
e.t = k
l.q = i
d.o = g
d.t = i
d.w = e
d.v = m
k.z = h
k.o = j
k.y = g
k.u = e
k.q = l
g.r = d
g.t = m
g.u = l
g.w = k
g.x = k
j.q = i
i.v = e
i.z = e
i.o = m
i.s = h
i.t = k
assert j.q.z.o.txt == "m"