class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: D = None
        self.x: E = None
        self.v: D = None
        self.t: H = None
        self.w: C = None
        self.q: G = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: D = None
        self.w: A = None
        self.x: F = None
        self.z: D = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: B = None
        self.o: F = None
        self.u: E = None
        self.r: A = None
        self.y: E = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: E = None
        self.u: B = None
        self.v: H = None
        self.y: F = None
        self.z: G = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: D = None
        self.w: A = None
        self.x: F = None
        self.z: D = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: B = None
        self.o: F = None
        self.u: E = None
        self.r: A = None
        self.y: E = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: E = None
        self.u: B = None
        self.v: H = None
        self.y: F = None
        self.z: G = None
        self.txt = txt

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

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

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

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

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

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