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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: F = None
        self.u: G = None
        self.z: E = None
        self.w: G = None
        self.s: H = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: D = None
        self.v: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: C = None
        self.t: D = None
        self.y: E = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: E = None
        self.w: A = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: C = None
        self.q: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: F = None
        self.u: G = None
        self.z: E = None
        self.w: G = None
        self.s: H = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: D = None
        self.v: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: C = None
        self.t: D = None
        self.y: E = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: E = None
        self.w: A = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: C = None
        self.q: D = None
        self.txt = txt

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

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