class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: F = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

n = A("n")
l = B("l")
d = C("d")
b = D("b")
k = E("k")
e = F("e")
g = G("g")
m = H("m")
i = F("i")

n.p = d
n.x = d
l.o = m
l.x = m
d.p = m
d.z = n
d.t = n
b.x = i
k.u = d
k.v = i
k.s = l
e.s = n
g.x = i
m.q = b
i.s = n
assert k.v.s.x.t.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: F = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

n = A("n")
l = B("l")
d = C("d")
b = D("b")
k = E("k")
e = F("e")
g = G("g")
m = H("m")
i = F("i")

n.p = d
n.x = d
l.o = m
l.x = m
d.p = m
d.z = n
d.t = n
b.x = i
k.u = d
k.v = i
k.s = l
e.s = n
g.x = i
m.q = b
i.s = n
assert k.v.s.x.t.x.t.txt == "n"