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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: A = None
        self.q: E = None
        self.z: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: C = None
        self.s: D = None
        self.w: F = None
        self.x: G = None
        self.t: D = None
        self.q: B = None
        self.txt = txt

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

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

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

h.p = k
h.y = k
h.z = b
j.s = h
j.z = k
k.y = n
k.z = n
k.o = h
k.q = a
b.s = n
a.p = k
a.z = k
a.s = b
a.t = b
a.w = f
a.x = n
a.q = j
f.r = n
n.q = l
n.w = j
l.p = k
l.z = k
l.s = b
l.t = b
l.w = f
l.x = n
l.q = j
assert j.s.z.s.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: C = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: A = None
        self.q: E = None
        self.z: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: C = None
        self.s: D = None
        self.w: F = None
        self.x: G = None
        self.t: D = None
        self.q: B = None
        self.txt = txt

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

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

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

h.p = k
h.y = k
h.z = b
j.s = h
j.z = k
k.y = n
k.z = n
k.o = h
k.q = a
b.s = n
a.p = k
a.z = k
a.s = b
a.t = b
a.w = f
a.x = n
a.q = j
f.r = n
n.q = l
n.w = j
l.p = k
l.z = k
l.s = b
l.t = b
l.w = f
l.x = n
l.q = j
assert j.s.z.s.w.z.txt == "k"