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

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

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

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

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

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

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

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

e.z = i
e.y = f
e.s = n
e.x = n
e.t = n
e.w = c
m.v = f
m.z = f
j.w = m
n.o = f
n.y = m
i.w = c
f.p = m
f.x = n
c.y = i
c.p = i
c.r = j
b.w = c
k.w = m
assert k.w.z.p.v.x.y.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: F = None
        self.s: D = None
        self.x: D = None
        self.w: G = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

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

e.z = i
e.y = f
e.s = n
e.x = n
e.t = n
e.w = c
m.v = f
m.z = f
j.w = m
n.o = f
n.y = m
i.w = c
f.p = m
f.x = n
c.y = i
c.p = i
c.r = j
b.w = c
k.w = m
assert k.w.z.p.v.x.y.z.x.txt == "n"