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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: D = None
        self.t: G = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: D = None
        self.t: G = None
        self.y: A = None
        self.txt = txt

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

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

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