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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: D = None
        self.p: I = None
        self.z: E = None
        self.w: C = None
        self.q: I = None
        self.r: E = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: F = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: A = None
        self.s: D = None
        self.o: I = None
        self.w: A = None
        self.z: D = None
        self.txt = txt

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

a = A("a")
h = B("h")
c = C("c")
f = D("f")
b = E("b")
i = F("i")
l = G("l")
j = H("j")
k = I("k")

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: D = None
        self.p: I = None
        self.z: E = None
        self.w: C = None
        self.q: I = None
        self.r: E = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: F = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: A = None
        self.s: D = None
        self.o: I = None
        self.w: A = None
        self.z: D = None
        self.txt = txt

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

a = A("a")
h = B("h")
c = C("c")
f = D("f")
b = E("b")
i = F("i")
l = G("l")
j = H("j")
k = I("k")

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