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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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