class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: B = None
        self.v: D = None
        self.o: F = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: D = None
        self.v: F = None
        self.r: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: D = None
        self.v: F = None
        self.r: B = None
        self.txt = txt

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

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