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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: A = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

a = A("a")
h = B("h")
i = C("i")
j = D("j")
l = E("l")
f = F("f")
k = G("k")
m = D("m")

a.t = i
a.v = h
a.y = h
a.z = k
a.r = k
h.o = i
h.y = a
h.x = m
i.s = f
i.u = f
i.w = m
i.t = m
i.r = l
i.o = k
i.z = a
j.s = l
l.x = h
f.o = l
f.x = l
f.u = a
f.q = k
f.r = k
f.w = m
f.p = m
k.p = j
m.s = l
assert l.x.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: B = None
        self.z: G = None
        self.r: G = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: A = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

a = A("a")
h = B("h")
i = C("i")
j = D("j")
l = E("l")
f = F("f")
k = G("k")
m = D("m")

a.t = i
a.v = h
a.y = h
a.z = k
a.r = k
h.o = i
h.y = a
h.x = m
i.s = f
i.u = f
i.w = m
i.t = m
i.r = l
i.o = k
i.z = a
j.s = l
l.x = h
f.o = l
f.x = l
f.u = a
f.q = k
f.r = k
f.w = m
f.p = m
k.p = j
m.s = l
assert l.x.o.z.txt == "a"