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

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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