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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: F = None
        self.q: F = None
        self.x: G = None
        self.z: G = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: D = None
        self.z: D = None
        self.w: F = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: A = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: H = None
        self.o: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: E = None
        self.t: F = None
        self.z: B = None
        self.w: A = None
        self.txt = txt

e = A("e")
b = B("b")
h = C("h")
k = D("k")
n = E("n")
i = F("i")
a = G("a")
j = H("j")

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: F = None
        self.q: F = None
        self.x: G = None
        self.z: G = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: D = None
        self.z: D = None
        self.w: F = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: A = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: H = None
        self.o: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: E = None
        self.t: F = None
        self.z: B = None
        self.w: A = None
        self.txt = txt

e = A("e")
b = B("b")
h = C("h")
k = D("k")
n = E("n")
i = F("i")
a = G("a")
j = H("j")

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