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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: B = None
        self.s: G = None
        self.p: G = None
        self.u: G = None
        self.r: C = None
        self.txt = txt

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

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

g = A("g")
f = B("f")
e = C("e")
k = D("k")
j = E("j")
n = F("n")
b = G("b")
l = F("l")
c = G("c")

g.z = e
f.x = c
f.t = c
f.z = j
f.w = j
f.s = k
e.s = b
e.t = c
k.x = l
j.t = e
j.r = e
j.x = f
j.s = c
j.u = c
j.p = b
n.z = g
n.s = e
b.w = k
b.z = e
b.r = e
b.y = e
b.t = g
b.p = f
b.u = j
l.z = g
l.s = e
c.w = k
c.z = e
c.r = e
c.y = e
c.t = g
c.p = f
c.u = j
assert c.t.z.t.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: B = None
        self.s: G = None
        self.p: G = None
        self.u: G = None
        self.r: C = None
        self.txt = txt

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

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

g = A("g")
f = B("f")
e = C("e")
k = D("k")
j = E("j")
n = F("n")
b = G("b")
l = F("l")
c = G("c")

g.z = e
f.x = c
f.t = c
f.z = j
f.w = j
f.s = k
e.s = b
e.t = c
k.x = l
j.t = e
j.r = e
j.x = f
j.s = c
j.u = c
j.p = b
n.z = g
n.s = e
b.w = k
b.z = e
b.r = e
b.y = e
b.t = g
b.p = f
b.u = j
l.z = g
l.s = e
c.w = k
c.z = e
c.r = e
c.y = e
c.t = g
c.p = f
c.u = j
assert c.t.z.t.p.s.txt == "k"