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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: B = None
        self.q: H = None
        self.p: D = None
        self.v: F = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

a = A("a")
d = B("d")
m = C("m")
k = D("k")
f = E("f")
h = F("h")
j = G("j")
c = H("c")

a.z = h
d.y = c
d.w = f
m.s = d
k.y = d
f.t = m
f.u = k
f.q = a
f.z = j
f.p = j
f.x = h
h.v = c
h.t = k
h.p = d
j.z = m
j.r = d
j.q = c
j.o = c
j.p = k
j.v = h
c.o = f
assert j.z.s.w.p.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: B = None
        self.q: H = None
        self.p: D = None
        self.v: F = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

a = A("a")
d = B("d")
m = C("m")
k = D("k")
f = E("f")
h = F("h")
j = G("j")
c = H("c")

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