class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: F = None
        self.z: H = None
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: D = None
        self.w: C = None
        self.x: C = None
        self.z: A = None
        self.txt = txt

l = A("l")
h = B("h")
e = C("e")
d = D("d")
f = E("f")
n = F("n")
j = G("j")
g = H("g")
m = F("m")

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: F = None
        self.z: H = None
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: D = None
        self.w: C = None
        self.x: C = None
        self.z: A = None
        self.txt = txt

l = A("l")
h = B("h")
e = C("e")
d = D("d")
f = E("f")
n = F("n")
j = G("j")
g = H("g")
m = F("m")

l.t = j
h.p = g
h.z = g
h.w = g
h.s = m
e.y = f
d.u = m
f.s = g
f.y = j
f.w = h
f.q = h
n.v = f
n.u = f
n.s = g
j.s = f
j.o = f
j.v = m
j.x = g
g.p = j
g.y = d
g.w = e
g.x = e
g.z = l
m.v = f
m.u = f
m.s = g
assert g.z.t.x.z.txt == "l"