class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: B = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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