class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: A = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: A = None
        self.v: D = None
        self.s: B = None
        self.r: H = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: A = None
        self.v: D = None
        self.s: B = None
        self.r: H = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

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

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

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

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