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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: C = None
        self.q: F = None
        self.x: D = None
        self.p: C = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: A = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: G = None
        self.txt = txt

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

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

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

k.o = d
k.u = i
a.t = n
a.x = n
a.s = b
a.p = b
a.r = b
a.q = i
b.z = n
n.x = f
f.o = a
f.s = k
f.x = l
j.q = i
j.u = l
l.v = j
l.x = f
d.z = f
d.s = n
d.v = l
d.p = a
i.q = j
i.u = l
assert b.z.x.x.x.o.q.u.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: C = None
        self.q: F = None
        self.x: D = None
        self.p: C = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: A = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: G = None
        self.txt = txt

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

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

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

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